Distributed convolution for neural networks

ABSTRACT

In one embodiment, a matrix operation may be performed using a plurality of input matrices, wherein the matrix operation is associated with one or more convolution operations. The plurality of input matrices may be partitioned into a plurality of input partitions, wherein the plurality of input matrices is partitioned based on a number of available processing elements. The plurality of input partitions may be distributed among a plurality of processing elements, wherein each input partition is distributed to a particular processing element of the plurality of processing elements. A plurality of partial matrix operations may be performed using the plurality of processing elements, and partial matrix data may be transmitted between the plurality of processing elements while performing the plurality of partial matrix operations. A result of the matrix operation may be determined based on the plurality of partial matrix operations.

FIELD OF THE SPECIFICATION

This disclosure relates in general to the field of computer processing,and more particularly, though not exclusively, to performing matrixoperations using a plurality of processing resources.

BACKGROUND

Matrix operations, such as matrix multiplication and convolutions, canbe highly processor-intensive and memory-intensive operations, as theyoften involve complex operations on large, multi-dimensional matrixoperands. Accordingly, the performance of complex matrix operations canbe limited by the processing and/or memory latency. As matrix operationsare increasingly utilized in a variety of applications and withever-growing data sets (from graphics and image processing to machinelearning and artificial intelligence), the demand for high-performanceprocessing of matrix operations is increasing.

BRIEF DESCRIPTION OF THE DRAWINGS

The present disclosure is best understood from the following detaileddescription when read with the accompanying figures. It is emphasizedthat, in accordance with the standard practice in the industry, variousfeatures are not necessarily drawn to scale, and are used forillustration purposes only. Where a scale is shown, explicitly orimplicitly, it provides only one illustrative example. In otherembodiments, the dimensions of the various features may be arbitrarilyincreased or reduced for clarity of discussion.

FIG. 1 illustrates a schematic diagram for an example computing systemaccording to certain embodiments.

FIGS. 2A-C illustrate block diagrams for an example embodiment of amatrix processing architecture.

FIGS. 3 and 4 illustrate block diagrams for example embodiments ofcomputer processors.

FIG. 5 illustrates an example convolution operation.

FIGS. 6A-G and 7A-F illustrate example neural network operationsassociated with convolutions.

FIG. 8 illustrates a flowchart for an example embodiment of distributedmatrix operations associated with convolutions.

EMBODIMENTS OF THE DISCLOSURE

The following disclosure provides many different embodiments, orexamples, for implementing different features of the present disclosure.Specific examples of components and arrangements are described below tosimplify the present disclosure. These are, of course, merely examplesand are not intended to be limiting. Further, the present disclosure mayrepeat reference numerals and/or letters in the various examples. Thisrepetition is for the purpose of simplicity and clarity and does not initself dictate a relationship between the various embodiments and/orconfigurations discussed. Different embodiments may have differentadvantages, and no particular advantage is necessarily required of anyembodiment.

Matrix processing operations (e.g., linear algebra operations thatinvolve matrix and/or vector operands) have a wide range of applicationsin computing systems, from graphics processing to machine learning andartificial intelligence, among other examples. For example, complexmatrix operations may be used to implement artificial neural networksthat provide artificial intelligence and machine learning capabilities,including computer vision, autonomous navigation, speech and audiorecognition, and natural language processing, among other examples.These complex matrix operations (e.g., matrix multiplication andconvolutions) may be used to implement the fundamental operations ofneural networks, such as forward propagation, backward propagation, andweight updates. These matrix operations, however, can be highlyprocessor and memory intensive, as they often involve complex operationson large, multi-dimensional matrix operands. Accordingly, theperformance of these matrix operations can be limited by processingand/or memory latency. As matrix operations are increasingly utilized ina variety of applications with ever-growing data sets, such asartificial intelligence and machine learning, the demand forhigh-performance processing of matrix operations is increasing.

Existing matrix processing approaches suffer from variousinefficiencies, particularly when used to implement artificialintelligence and machine learning in artificial neural networks. Forexample, while central processing units (CPUs) could be used to performmatrix operations, many CPU architectures are designed for lowarithmetic intensity operations (i.e., a low ratio of arithmeticoperations relative to memory operations), and thus are not designed forefficient execution of matrix operations. Moreover, many CPUarchitectures utilize complex local or cache memory management routines,which may increase processing overhead and execution complexity foroperations involving large matrix operands. Graphics processing units(GPUs) could also be used to perform matrix operations. GPUs, however,are often designed for high precision computations and may provide alevel of precision that is unnecessary for certain matrix operations,thus reducing the volume of matrix operations that can be performed.Accordingly, existing matrix processing approaches are inefficient forcertain matrix operations, such as matrix multiplication or convolutionoperations involving large matrix operands and/or matrix operands withcertain dimensions, among other examples. The existing approaches areunable to perform these matrix operations with 100% processingefficiency using all available processing resources. Moreover, existingapproaches cannot be efficiently scaled to perform these matrixoperations across additional processing resources in parallel. As anexample, existing approaches are inefficient for matrix multiplication(e.g., general matrix multiplication or GEMM) on a large matrix operandwhich is neither square nor a single vector, such as a “thin” matrixwith a much larger height than width. Existing approaches require moretime to access and communicate the matrix operands than to perform theactual matrix computations, resulting in idle processing time whilematrix operands are being obtained from memory and/or communicated toprocessing resources. Similarly, existing approaches are inefficient forconvolution operations on large matrix operands, as they are unable toefficiently distribute or scale a convolution operation across avariable number of processing resources. Thus, existing approaches donot achieve 100% processing efficiency for these matrix operations.

The matrix processing functionality described throughout this disclosureperforms matrix operations using a distributed approach that achieves100% processing efficiency using the available processing resources. Forexample, this approach distributes matrix operations across multipleprocessing resources in a processing architecture that is optimized forperforming matrix operations, thus enabling full utilization of theprocessing resources throughout the duration of the matrix operations.For example, the processing architecture may include multiple processingresources that are designed and optimized for performing matrixoperations, and may support a higher volume of matrix operations thanother architectures (e.g., GPUs). In some embodiments, these processingresources may be configured in a cyclical arrangement, with eitherunidirectional communication interfaces between neighboring processingresources (a “single-cyclical” configuration) or bi-directionalcommunication interfaces between neighboring processing resources (a“dual-cyclical” configuration). In addition, the processing resourcesmay be arranged hierarchically with multiple levels of processingresources. For example, in some embodiments, the processing resourcesmay include multiple matrix processing chips, multiple high bandwidthmemory (HBM) modules and matrix processing clusters on each matrixprocessing chip, and/or multiple matrix processing units (MPUs) on eachmatrix processing cluster. This processing architecture enables matrixoperations to be distributed across multiple processing resources and/orprocessing hierarchies with 100% processing efficiency. In addition,this processing architecture enables matrix operations to be efficientlyscaled across a variable number of processing resources operating inparallel, while still achieving 100% processing efficiency.

The distributed matrix processing functionality described throughoutthis disclosure provides numerous technical advantages, includingalleviating the inefficiencies of existing approaches and enablingmatrix operations to be executed efficiently, achieving 100% processingefficiency using the available processing resources, and efficientlyscaling matrix operations across a variable number of processingresources operating in parallel. These advantages result in reducedprocessing time for matrix operations, which improves performance forapplications that involve complex matrix operations, such as artificialintelligence and machine learning functionality implemented usingartificial neural networks (e.g., convolutional neural networks,multilayer perceptrons (MLPs), restricted Boltzmann machines (RBM), anddeep belief networks (DBN), among other examples).

Example embodiments that may be used to implement the matrix processingfunctionality of this disclosure will now be described with moreparticular reference to the attached FIGURES.

FIG. 1 illustrates a schematic diagram for an example computing system100 according to certain embodiments.

In some embodiments, the matrix processing functionality describedthroughout this disclosure may be implemented in system 100. Matrixprocessing functionality may be used in system 100 for a wide range ofapplications and/or use cases involving matrix operations, from graphicsprocessing to machine learning and artificial intelligence, among otherexamples. For example, in some embodiments, matrix processingfunctionality may be used to implement artificial intelligence andmachine learning in artificial neural networks. Moreover, matrixprocessing functionality may be implemented by any component of system100. For example, in the illustrated embodiment, system 100 includesedge devices 110, cloud services 120, matrix processing nodes 130, andnetwork 150. Matrix processing nodes 130 may include any component ordevice with matrix processing functionality, including any component ofsystem 100. For example, matrix processing nodes 130 may include cloudservices 120 and/or servers implemented with matrix processingfunctionality (e.g., application servers in a datacenter), edge devices110 implemented with matrix processing functionality (e.g., end-userdevices 112, Internet-of-Things devices 114, gateways 116), and soforth. These various components of system 100 are discussed furtherbelow.

Edge devices 110 may include any equipment and/or devices deployed orconnected near the “edge” of a communication system 100. Edge devices110 may communicate with each other and/or with other remote networksand services (e.g., cloud services 120) through one or more networksand/or communication protocols, such as network 150. In someembodiments, certain edge devices 110 may include the matrix processingfunctionality described throughout this disclosure, and thus may be usedas matrix processing nodes 130. In the illustrated embodiment, edgedevices 110 include end-user devices 112 (e.g., desktops, laptops,mobile devices), Internet-of-Things (IoT) devices 114, and gatewaysand/or routers 116, among other examples.

End-user devices 112 may include any device that enables or facilitatesuser interaction with computing system 100, including, for example,desktop computers, laptops, tablets, mobile phones and other mobiledevices, and wearable devices (e.g., smart watches, smart glasses,headsets), among other examples.

IoT devices 114 may include any device capable of communicating and/orparticipating in an Internet-of-Things (IoT) system or network. IoTsystems may refer to new or improved ad-hoc systems and networkscomposed of multiple different devices (e.g., IoT devices 114)interoperating and synergizing for a particular application or use case.Such ad-hoc systems are emerging as more and more products and equipmentevolve to become “smart,” meaning they are controlled or monitored bycomputer processors and are capable of communicating with other devices.For example, an IoT device 114 may include a computer processor and/orcommunication interface to allow interoperation with other components ofsystem 100, such as with cloud services 120 and/or other edge devices110. IoT devices 114 may be “greenfield” devices that are developed withIoT capabilities from the ground-up, or “brownfield” devices that arecreated by integrating IoT capabilities into existing legacy devicesthat were initially developed without IoT capabilities. For example, insome cases, IoT devices 114 may be built from sensors and communicationmodules integrated in or attached to “things,” such as equipment, toys,tools, vehicles, living things (e.g., plants, animals, humans), and soforth. Alternatively, or additionally, certain IoT devices 114 may relyon intermediary components, such as edge gateways or routers 116, tocommunicate with the various components of system 100.

IoT devices 114 may include various types of sensors for monitoring,detecting, measuring, and generating sensor data and signals associatedwith characteristics of their environment. For instance, a given sensormay be configured to detect one or more respective characteristics, suchas movement, weight, physical contact, temperature, wind, noise, light,position, humidity, radiation, liquid, specific chemical compounds,battery life, wireless signals, computer communications, and bandwidth,among other examples. Sensors can include physical sensors (e.g.,physical monitoring components) and virtual sensors (e.g.,software-based monitoring components). IoT devices 114 may also includeactuators to perform various actions in their respective environments.For example, an actuator may be used to selectively activate certainfunctionality, such as toggling the power or operation of a securitysystem (e.g., alarm, camera, locks) or household appliance (e.g., audiosystem, lighting, HVAC appliances, garage doors), among other examples.

Indeed, this disclosure contemplates use of a potentially limitlessuniverse of IoT devices 114 and associated sensors/actuators. IoTdevices 114 may include, for example, any type of equipment and/ordevices associated with any type of system 100 and/or industry,including transportation (e.g., automobile, airlines), industrialmanufacturing, energy (e.g., power plants), telecommunications (e.g.,Internet, cellular, and television service providers), medical (e.g.,healthcare, pharmaceutical), food processing, and/or retail industries,among others. In the transportation industry, for example, IoT devices114 may include equipment and devices associated with aircrafts,automobiles, or vessels, such as navigation systems, autonomous flightor driving systems, traffic sensors and controllers, and/or any internalmechanical or electrical components that are monitored by sensors (e.g.,engines). IoT devices 114 may also include equipment, devices, and/orinfrastructure associated with industrial manufacturing and production,shipping (e.g., cargo tracking), communications networks (e.g.,gateways, routers, servers, cellular towers), server farms, electricalpower plants, wind farms, oil and gas pipelines, water treatment anddistribution, wastewater collection and treatment, and weathermonitoring (e.g., temperature, wind, and humidity sensors), among otherexamples. IoT devices 114 may also include, for example, any type of“smart” device or system, such as smart entertainment systems (e.g.,televisions, audio systems, videogame systems), smart household oroffice appliances (e.g., heat-ventilation-air-conditioning (HVAC)appliances, refrigerators, washers and dryers, coffee brewers), powercontrol systems (e.g., automatic electricity, light, and HVAC controls),security systems (e.g., alarms, locks, cameras, motion detectors,fingerprint scanners, facial recognition systems), and other homeautomation systems, among other examples. IoT devices 114 can bestatically located, such as mounted on a building, wall, floor, ground,lamppost, sign, water tower, or any other fixed or static structure. IoTdevices 114 can also be mobile, such as devices in vehicles oraircrafts, drones, packages (e.g., for tracking cargo), mobile devices,and wearable devices, among other examples. Moreover, an IoT device 114can also be any type of edge device 110, including end-user devices 112and edge gateways and routers 116.

Edge gateways and/or routers 116 may be used to facilitate communicationto and from edge devices 110. For example, gateways 116 may providecommunication capabilities to existing legacy devices that wereinitially developed without any such capabilities (e.g., “brownfield”IoT devices). Gateways 116 can also be utilized to extend thegeographical reach of edge devices 110 with short-range, proprietary, orotherwise limited communication capabilities, such as IoT devices 114with Bluetooth or ZigBee communication capabilities. For example,gateways 116 can serve as intermediaries between IoT devices 114 andremote networks or services, by providing a front-haul to the IoTdevices 114 using their native communication capabilities (e.g.,Bluetooth, ZigBee), and providing a back-haul to other networks 150and/or cloud services 120 using another wired or wireless communicationmedium (e.g., Ethernet, Wi-Fi, cellular). In some embodiments, a gateway116 may be implemented by a dedicated gateway device, or by a generalpurpose device, such as another IoT device 114, end-user device 112, orother type of edge device 110.

In some instances, gateways 116 may also implement certain networkmanagement and/or application functionality (e.g., IoT management and/orIoT application functionality for IoT devices 114), either separately orin conjunction with other components, such as cloud services 120 and/orother edge devices 110. For example, in some embodiments, configurationparameters and/or application logic may be pushed or pulled to or from agateway device 116, allowing IoT devices 114 (or other edge devices 110)within range or proximity of the gateway 116 to be configured for aparticular IoT application or use case.

Cloud services 120 may include services that are hosted remotely over anetwork 150, or in the “cloud.” In some embodiments, for example, cloudservices 120 may be remotely hosted on servers in datacenter (e.g.,application servers or database servers). Cloud services 120 may includeany services that can be utilized by or for edge devices 110, includingbut not limited to, data storage, computational services (e.g., dataanalytics, searching, diagnostics and fault management), securityservices (e.g., surveillance, alarms, user authentication), mapping andnavigation, geolocation services, network or infrastructure management,IoT application and management services, payment processing, audio andvideo streaming, messaging, social networking, news, and weather, amongother examples. In some embodiments, certain cloud services 120 mayinclude the matrix processing functionality described throughout thisdisclosure, and thus may be used as matrix processing nodes 130.

In general, edge devices 110 (and in particular IoT devices 114) maygenerate an extremely large volume and variety of data. IoT edge devices114 typically offload this data to the cloud for processing and/orstorage (e.g., by cloud services 120). Cloud services 120, however, maynot necessarily be suited to handle the rapidly growing volume, variety,and velocity of data generated by IoT devices 114 and other edge devices110. For example, cloud-based processing may not be ideal in certaincircumstances, such as processing time-sensitive or highly confidentialdata, or when faced with network bandwidth constraints, among otherexamples. In some embodiments, cloud services 120 may leverage “edge”based processing using edge devices 110 to improve the performance ofcloud services. Edge processing is an approach that involves processingcertain data at the network edge (e.g., using edge devices 110), nearwhere the data is generated, rather than simply funneling large volumesof data to the cloud for processing and storage. Certain data may stillbe sent to the cloud, as appropriate, such as for deeper analysis and/orlong-term storage. Edge processing may be used to complement theshortcomings of cloud-based processing (e.g., when cloud-basedprocessing is inefficient, ineffective, and/or unsecure), and thusimprove the handling of the growing volume, variety, and velocity ofdata generated by IoT devices 114 and/or other edge devices 110. Forexample, in some cases, processing data near its source (e.g., in thenetwork edge) rather than in the cloud may improve performance and/oravoid system failures or disasters. Edge processing may also conservenetwork bandwidth, which may be particularly beneficial when facingbandwidth constraints and/or limited network connectivity.

In some embodiments, edge devices 110 that provide edge-based processingfor cloud services 120 may be collectively referred to as the “fog,” asthey serve to extend the “cloud” to the edge of the network, thuscreating a “fog” over the network edge. In some embodiments, devices 110in the “fog” may connect and/or communicate with each other, forexample, using an interconnection standard or protocol. For example, insome embodiments, device interconnection may be implemented using theopen interconnect consortium (OIC) standard specification 1.0, releasedby the Open Connectivity FoundationTM (OCF) on Dec. 23, 2015, whichenables devices to discover and connect with each other. Anotherinterconnection protocol that may be used is Thread, a networkingprotocol for Internet-of-Things (IoT) devices used in “smart” homeautomation and similar deployments, which has been developed by analliance of organizations named the “Thread Group.” Otherinterconnection protocols may also be used, including, for example, theoptimized link state routing (OLSR) protocol, or the better approach tomobile ad-hoc networking (B.A.T.M.A.N.), among others.

Network 150 may be used to facilitate communication between thecomponents of computing system 100. For example, edge devices 110, suchas end-user devices 112 and IoT devices 114, may use network 150 tocommunicate with each other and/or access one or more remote cloudservices 120. Network 150 may include any number or type ofcommunication networks, including, for example, local area networks,wide area networks, public networks, the Internet, cellular networks,Wi-Fi networks, short-range networks (e.g., Bluetooth or ZigBee), and/orany other wired or wireless networks or communication mediums.

Any, all, or some of the computing devices of system 100 may be adaptedto execute any operating system, including Linux or other UNIX-basedoperating systems, Microsoft Windows, Windows Server, MacOS, Apple iOS,Google Android, or any customized and/or proprietary operating system,along with virtual machines adapted to virtualize execution of aparticular operating system.

While FIG. 1 is described as containing or being associated with aplurality of elements, not all elements illustrated within system 100 ofFIG. 1 may be utilized in each alternative implementation of the presentdisclosure. Additionally, one or more of the elements described inconnection with the examples of FIG. 1 may be located external to system100, while in other instances, certain elements may be included withinor as a portion of one or more of the other described elements, as wellas other elements not described in the illustrated implementation.Further, certain elements illustrated in FIG. 1 may be combined withother components, as well as used for alternative or additional purposesin addition to those purposes described herein.

Example Matrix Processing Architecture

FIGS. 2A-C illustrate block diagrams for an example embodiment of amatrix processing architecture.

In some embodiments, the matrix processing functionality describedthroughout this disclosure may be implemented using a matrix processingarchitecture, such as the matrix processing architecture of FIGS. 2A-2C.Matrix processing architectures, such as the matrix processingarchitecture of FIGS. 2A-2C, may be implemented or used in a variety ofsystems, devices, and/or components, such as those described throughoutthis disclosure, including system 100 of FIG. 1 and/or any of itsassociated components (e.g., cloud services 120/datacenter servers, edgedevices 110, matrix processing nodes 130). In some embodiments, thematrix processing architecture of FIGS. 2A-2C may be used to implementartificial intelligence and machine learning in neural networks. Thematrix processing architecture illustrated in FIGS. 2A-2C is merely oneexample embodiment for performing the matrix processing functionalitydescribed throughout this disclosure. Other embodiments may usedifferent types, arrangements, and/or numbers of components. Forexample, other embodiments may include any number of matrix processingchips 220, matrix processing clusters 230, matrix processing units(MPUs) 234, high bandwidth memory (HBM) modules 240, and/or memoryresource blocks (MRBs) 238. Moreover, all or part of any component ofthe matrix processing architecture of FIGS. 2A-2C (e.g., any componentof matrix processing system 200, matrix processing chips 220, and/ormatrix processing clusters 230) may be implemented as a separate orstand-alone component or chip, or may be integrated with othercomponents or chips, such as a system-on-a-chip (SoC) that integratesvarious computer components into a single chip.

FIG. 2A illustrates a block diagram for an example embodiment of amatrix processing system 200. In the illustrated embodiment, matrixprocessing system 200 includes host processor 260, host memory 270,matrix processing resources 210, and interconnect bus 280.

Host processor 260 may be configured to control and/or manage matrixprocessing system 200. For example, in some embodiments, host processor260 may use matrix processing resources 210 to perform complex matrixoperations. Host processor 260 may be any processing resource capable ofcontrolling and/or managing matrix processing functionality of matrixprocessing system 200. For example, in some embodiments, host processor260 may be implemented using computer processors 300 or 400 of FIGS. 3and 4, respectively. In some embodiments, host processor 260 may be aseparate or stand-alone component that is communicatively coupled tomatrix processing resources 210. Alternatively, in other embodiments,host processor 260 and matrix processing resources 210 may be integratedinto the same component or chip. For example, in some embodiments, thecomponents of matrix processing system 200, including host processor 260and matrix processing resources 210, may be implemented as asystem-on-a-chip (SoC).

Host memory 270 may include any type or combination of volatile and/ornon-volatile memory. Examples of volatile memory include various typesof random access memory (RAM), such as dynamic random access memory(DRAM), synchronous dynamic random access memory (SDRAM), and staticrandom access memory (SRAM), among other examples. Examples ofnon-volatile memory include disk-based storage mediums (e.g., magneticand/or optical storage mediums), solid-state storage (e.g., any form ofpersistent flash memory, including planar or three dimensional (3D) NANDflash memory or NOR flash memory), 3D crosspoint memory, electricallyerasable programmable read-only memory (EEPROM), and/or other types ofnon-volatile random access memories (RAM), among other examples. Hostmemory 270 may be used, for example, to store information for hostprocessor 260 during execution, such as code and/or data.

Interconnect bus 280 may be used, in some embodiments, tocommunicatively couple host processor 260 and host memory 270 to matrixprocessing resources 210. Interconnect bus 280 may use anyinterconnection protocol, such as Peripheral Component Interconnectexpress (PCIe), Universal Serial Bus (USB), or Small Computer SystemsInterface (SCSI), among other examples.

Matrix processing resources 210 may include any processing resourcesconfigured to perform matrix operations. For example, matrix processingresources 210 may be configured to perform matrix multiplicationoperations, convolution operations, element-wise matrix operations(e.g., +, *,/<, >, ==), dimension shuffle operations, and/or anycombination thereof. In some embodiments, matrix processing resources210 may include processing resources that are designed and optimized forperforming matrix operations. In some embodiments, matrix processingresources 210 may also be arranged hierarchically with multiple levelsof processing resources. For example, in the illustrated embodiment,matrix processing resources 210 include a plurality of matrix processingchips 220, and may also include any processing resources within eachmatrix processing chip 220. For example, as discussed below inconnection with FIGS. 2B and 2C, each matrix processing chip 220 mayinclude a plurality of high bandwidth memory (HBM) modules 240 and aplurality of matrix processing clusters 230, and each matrix processingcluster 230 may include multiple matrix processing units 234. Thus, insome embodiments, matrix processing resources 210 may include multiplematrix processing chips 220, multiple high bandwidth memory (HBM)modules 240 and multiple matrix processing clusters 230 on each matrixprocessing chip 220, and/or multiple matrix processing units 234 on eachmatrix processing cluster 230.

Matrix processing chips 220 may be, for example, any chips or othercomponents configured to perform matrix operations. For example, in someembodiments, a matrix processing chip 220 may be a peripheral card orchip connected to host processor 260 using any type of interconnectinterface, such as a PCIe interface. In some embodiments, a matrixprocessing chip 220 may be implemented using an integrated circuit, suchas an application specific integrated circuit (ASIC), a fieldprogrammable gate array (FPGA), and/or any other type of circuitry. Inthe illustrated embodiment, matrix processing chips 220 are configuredin a cyclical arrangement, with communication channels 215 betweenneighboring matrix processing chips 220. In some embodiments,communication channels 215 may provide one-way communication betweenneighboring matrix processing chips 220. In other embodiments, however,communication channels 215 may provide bi-directional communicationbetween neighboring matrix processing chips 220. A cyclical arrangementwith one-way communication between neighboring processing resources maybe referred to as a “single-cyclical” configuration, while a cyclicalarrangement with bi-directional communication between neighboringprocessing resources may be referred to as a “dual-cyclical”configuration.

Moreover, although not illustrated, in some embodiments matrixprocessing system 200 may include a communication interface tocommunicate over a communication network. For example, in someembodiments, matrix processing system 200 may communicate over a networkwith one or more remote matrix processing chips to perform distributedmatrix operations.

FIG. 2B illustrates a block diagram for an example embodiment of amatrix processing chip 220. In the illustrated embodiment, matrixprocessing chip 220 includes controller 222, host interface 224,inter-chip links 225, high bandwidth memory (HBM) modules 240, andmatrix processing clusters 230.

Controller 222 may be configured to control and/or manage matrixoperations performed by matrix processing chip 220. In some embodiments,controller 222 may control and/or manage matrix operations inconjunction with host processor 260 of FIG. 2A and/or master controlCPUs (MCCs) 232 of matrix processing clusters 230 of FIG. 2C. Forexample, in some embodiments, host processor 260, controller 222, and/ormaster control CPUs (MCCs) 232 may be configured to receive a matrixoperation or command, and distribute the matrix operation and matrixoperands across matrix processing clusters 230 and high bandwidth memory(HBM) modules 240. In some embodiments, controller 222 may be amicroprocessor, an integrated circuit, and/or any other type ofcircuitry and/or processing logic.

Host interface 224 may be a communication interface that enables amatrix processing chip 220 to communicate with host processor 260 ofFIG. 2A. In some embodiments, for example, controller 222 may use hostinterface 224 to communicate with host processor 260 of FIG. 2A. Hostinterface 224 may use any type of interconnect protocol or interface,including Peripheral Component Interconnect express (PCIe), UniversalSerial Bus (USB), or Small Computer Systems Interface (SCSI), amongother examples.

Inter-chip links (ICLs) 225 may enable a matrix processing chip 220 tocommunicate with other matrix processing chips. For example, inter-chiplinks 225 may be used to implement the communication channels 215between matrix processing chips 220 in FIG. 2A. An inter-chip link 225may be, for example, any communication interface that enables a matrixprocessing chip 220 to communicate with another matrix processing chip.In some embodiments, a matrix processing chip 220 may include multipleinter-chip links 225 (e.g., twelve inter-chip links). In someembodiments, an inter-chip link 225 may be implemented using one or moreserializer/de-serializer (SerDes) interfaces. A SerDes interface may bea communication interface that converts data from serial to parallel,and vice-versa. For example, the transmitter of a SerDes interface mayinclude a serial-to-parallel converter, and the receiver of a SerDesinterface may include a parallel-to-serial converter. In someembodiments, a matrix processing chip 220 may use multiple SerDesinterfaces for each connection to another matrix processing chip (e.g.,four SerDes interfaces between each pair of connected matrix processingchips).

High bandwidth memory (HBM) modules 240 may be memory componentsassociated with matrix processing chip 220 that are used to store matrixoperands and other matrix data. In some embodiments, high bandwidthmemory (HBM) modules 240 may be designed to efficiently store andretrieve matrix data. In some embodiments, high bandwidth memory (HBM)modules 240 may be multi-dimensional memory components configured tostore and retrieve data in multiple dimensions. For example, in someembodiments, high bandwidth memory (HBM) modules 240 may be memorycomponents configured to store and retrieve data in two dimensions, suchas rows and columns. Other embodiments, however, may use memorycomponents configured to store and retrieve data using any other numberof dimensions (e.g., one dimension, three dimensions, four dimensions,and so forth). In the illustrated embodiment, matrix processing chip 220includes four high bandwidth memory (HBM) modules 240 a-d. In someembodiments, high bandwidth memory (HBM) modules 240 may be shared bythe matrix processing clusters 230 of a matrix processing chip 220.

Matrix processing clusters 230 may include processing resourcesconfigured to perform matrix operations, such as matrix multiplication,convolutions, and/or dimension shuffling, among other examples. In someembodiments, matrix processing clusters 230 may be collectively used toexecute a particular matrix operation by performing matrix processing inparallel. In the illustrated embodiment, matrix processing chip 220includes twelve matrix processing clusters 230 a-l. Moreover, in theillustrated embodiment, matrix processing clusters 230 are configured orarranged using a two-dimensional mesh interconnection topology. Theinterconnection topology of matrix processing clusters 230 mayfacilitate cyclical communication among the matrix processing clusters230. Moreover, other embodiments may include any number and/orarrangement of matrix processing clusters 230.

FIG. 2C illustrates a block diagram for an example embodiment of amatrix processing cluster 230. In the illustrated embodiment, matrixprocessing cluster 230 includes master control CPU (MCC) 232, matrixprocessing units (MPUs) 234, slicing engine 236, and memory resourceblocks (MRBs) 238.

Master control CPU (MCC) 232 may be configured to control and/or managematrix operations performed by a matrix processing cluster 230. In someembodiments, master control CPU 232 may be a microprocessor, anintegrated circuit, and/or any other type of circuitry and/or processinglogic. In some embodiments, master control CPU 232 may receiveinstructions from another component, such as host processor 260 of FIG.2A and/or controller 222 of FIG. 2B. Based on the instructions, mastercontrol CPU 232 may then use matrix processing units 234 to performmatrix operations, such as matrix multiplication, convolutions, and/ordimension shuffling, among other examples. For example, master controlCPU 232 may receive an instruction to perform a matrix multiplicationoperation, such as C=A* B. The instruction may include the handles oridentifiers for each matrix, and may also indicate how the matricesshould be stored in memory resource blocks (MRBs) 238. Matrices A and Bmay then be broken down into a series of smaller matrices (e.g., 32×32matrices). Matrix operations may then be performed on the smallermatrices, and the partial results may be stored in memory resourceblocks (MRBs) 238, until the output matrix C has been fully computed.

Matrix processing units (MPUs) 234 may be configured to perform matrixoperations, such as matrix multiplication, convolutions, and/ordimension shuffling. In some embodiments, matrix processing units (MPUs)234 perform matrix operations based on commands received from mastercontrol CPU (MCC) 232. Moreover, in some embodiments, each matrixprocessing cluster 230 may include multiple matrix processing units(MPUs) 234. For example, in the illustrated embodiment, matrixprocessing cluster 230 includes two matrix processing units (MPUs) 234.A matrix processing unit (MPU) 234 may be capable of performing matrixoperations, such as matrix multiplication, on small matrices (e.g.,32×32 matrices). In some cases, a matrix processing unit (MPU) 234 maybe designed and/or optimized to perform matrix multiplicationoperations. A matrix processing unit (MPU) 234 may load matrix operandsfrom memory resource blocks (MRBs) 238. In some embodiments, a matrixprocessing unit (MPU) 234 may support the following arithmeticoperations: matrix multiplication; unary matrix operations; binarymatrix operations, such as addition (+), subtraction (−), multiplication(*), division (/), bitwise XOR, AND, OR, logical and arithmetic left andright shift, comparison (>, <, >=, <=, ==, !=); and column-wise,row-wise, and matrix-wide operations, such as sum, max value, and minvalue.

Slicing engine 236 may be configured to slice the matrix operands of aparticular matrix operation into smaller partial matrices. For example,in some embodiments, master control CPU (MCC) 232 may use slicing engine236 to break up matrix operands into smaller partial matrices for matrixprocessing units (MPUs) 234. In some embodiments, slicing engine 236 mayinclude a convolution slicing engine (CSE) to perform matrix slicing forconvolution operations. For example, in some embodiments, a convolutionslicing engine (CSE) may slice matrix operands in a manner that enablesa convolution operation to be cast as a matrix multiplication operation,thus enabling the same processing logic to perform both matrixmultiplication and convolution operations. Moreover, in someembodiments, slicing engine 236 and/or the associated convolutionslicing engine (CSE) may be used to perform the dimension shuffleoperations to reorder the dimensions of a matrix.

Memory resource blocks (MRBs) 238 may be memory components on matrixprocessing cluster 230 used to store matrix operands and other matrixdata. In some embodiments, memory resource blocks (MRBs) 238 may bedesigned to store and retrieve matrix data efficiently. In someembodiments, memory resource blocks (MRBs) 238 may be multi-dimensionalmemory components configured to store and retrieve data in multipledimensions. For example, in some embodiments, memory resource blocks(MRBs) 238 may be memory components configured to store and retrievedata in two dimensions, such as rows and columns. In the illustratedembodiment, matrix processing cluster 230 includes ten memory resourceblocks (MRBs) 238. Other embodiments, however, may include a differentnumber of memory resource blocks (MRBs) 238 on a matrix processingcluster 230. In some embodiments, each memory resource block (MRB) 238may be capable of storing a matrix of a certain size (e.g., a 256×512matrix). In some embodiments, memory resource blocks (MRBs) 238 may beshared by the matrix processing units (MPUs) 234 of a particular matrixprocessing cluster 230.

In some embodiments, the matrix processing architecture of FIGS. 2A-2Cmay be used to implement the matrix processing functionality describedthroughout this disclosure. For example, matrix processing system 200may be used to perform matrix operations using a distributed approachthat achieves 100% processing efficiency using the available processingresources. For example, in some embodiments, a matrix operation may bedistributed across multiple processing resources 210 that are optimizedfor matrix processing, thus enabling full utilization of the processingresources 210 throughout the duration of the matrix operation. Forexample, matrix processing system 200 may include multiple processingresources 210 that are designed and optimized for performing matrixoperations. In some embodiments, these processing resources 210 may beconfigured in a single-cyclical or dual-cyclical arrangement. Inaddition, the processing resources 210 may be arranged hierarchicallywith multiple levels of processing resources. For example, in someembodiments, the processing resources 210 may include multiple matrixprocessing chips 220, multiple high bandwidth memory (HBM) modules 240and multiple matrix processing clusters 230 on each matrix processingchip 220, and/or multiple matrix processing units (MPUs) 234 on eachmatrix processing cluster 230. This processing architecture enablesmatrix operations to be distributed across multiple processing resources210 and/or processing hierarchies with 100% processing efficiency. Inaddition, this processing architecture enables matrix operations to beefficiently scaled across a variable number of processing resources 210operating in parallel, while still achieving 100% processing efficiency.For example, scaling may be achieved by adjusting the number ofprocessing resources 210 used to perform a particular matrix operation,such as the number of matrix processing systems 200 or servers, thenumber of matrix processing chips 220 in each matrix processing system200 or server, and so forth.

As an example, the matrix processing architecture of FIGS. 2A-2C may beused to implement matrix multiplication and/or convolution operations.For example, in some embodiments, a matrix multiplication operation maybe distributed across multiple processing resources 210 in a manner thatresults in the latency for communicating matrix operands being less thanthe matrix processing time, which allows the communication of matrixoperands to be completed while the matrix processing is being performed.For example, for certain matrix operations involving matrix operandswith certain dimensions (e.g., matrix multiplication with a “thin”matrix operand), the time required to access and communicate matrixoperands may exceed the time required to perform the actual matrixcomputations, resulting in idle processing time while the matrixoperands are being obtained from memory and/or communicated toprocessing resources 210. For example, a single-cyclical configuration(e.g., where each processing resource 210 only obtains matrix operandsand data from one neighboring processing resource 210 at any given time)may be unable to achieve 100% processing efficiency for these particulartypes of matrix operations and matrix operands. However, a dual-cyclicalconfiguration of processing resources 210 enables each processingresource to perform matrix computations while simultaneously obtainingmatrix operands and data from both of its neighboring processingresources 210, which significantly reduces the latency for communicatingmatrix operands, and thus avoids any idle processing time. For example,the communication latency for certain operations may be reduced by halfwhen using a dual-cyclical approach as opposed to a single-cyclicalapproach. In this manner, the latency for communicating matrix operandsand matrix data can be fully masked by the matrix processing time, thusavoiding any wasted or idle processing time and achieving 100%processing efficiency. Accordingly, matrix operations (e.g., matrixmultiplication or GEMM) can be performed efficiently even for largematrix operands and/or matrix operands with certain dimensions, such asa large matrix operand that is neither square nor a single vector (e.g.,a “thin” matrix with a much larger height than width). For example,matrix multiplication can be performed efficiently even when multiplyingtwo thin matrices, a thin matrix and a square matrix, and so forth.Similarly, convolution operations may be distributed across multipleprocessing resources 210 in a manner that results in 100% processingefficiency using the available processing resources.

As an example, when a matrix operation or command is received, thematrix operation may be distributed across the processing resources 210of matrix processing system 200. For example, the matrix operands (orinput matrices) may be partitioned based on the number of availableprocessing resources 210. Moreover, in some embodiments, the partitionsmay be across the rows of the matrix operands, and/or across any otherdimension of the matrix operands. Each partition may then be distributedto a particular processing resource 210. Each processing resource 210may then perform a plurality of partial matrix operations. In someembodiments, the plurality of partial matrix operations is performed ina plurality of stages. For example, each processing resource 210 mayperform a particular stage of partial matrix operations whilesimultaneously sending and receiving partial matrix data to and from itsneighboring processing resources 210. For example, in a single-cyclicalconfiguration of processing resources 210, each processing resource 210either sends or receives partial matrix data to or from each neighborprocessing resource. Similarly, in a dual-cyclical configuration ofprocessing resources 210, each processing resource 210 may send andreceive partial matrix data to and from each neighboring processingresource 210.

Each processing resource 210 may then use the partial matrix data forsubsequent partial matrix operations. The result of the matrix operationmay then be determined based on the partial matrix operationscollectively performed by the processing resources 210.

Moreover, if the processing resources 210 are arranged hierarchically,the matrix operation may be distributed in a hierarchical manner. Forexample, the matrix operands (or input matrices) may initially bepartitioned based on the number of available matrix processing chips220. Each partition, and the associated partial matrix operations, maythen be distributed to a particular matrix processing chip 220. Thepartition and partial matrix operations distributed to a particularmatrix processing chip 220 may then be similarly partitioned anddistributed across the matrix processing clusters 230 and/or highbandwidth memory (HBM) modules 240 of the particular matrix processingchip 220. For example, for certain matrix operations, partial matrixoperations may be distributed to each matrix processing cluster 230.Alternatively, for certain matrix operations, partial matrix operationsmay be distributed across various “logical processing nodes” (e.g.,groups of matrix processing clusters 230 associated with ahigh-bandwidth memory (HBM) module 240), and may then be distributed toeach matrix processing cluster 230 of a particular logical processingnode. In some embodiments, the matrix processing clusters 230 (and/orthe logical processing nodes) may be cyclically configured similar tothe matrix processing chips 220. The partition and partial matrixoperations distributed to a particular matrix processing cluster 230 maythen be similarly partitioned and distributed across the matrixprocessing units (MPUs) 234 of the particular matrix processing cluster230.

Example Computer Processor Architectures

FIGS. 3 and 4 illustrate block diagrams for example embodiments ofcomputer processors that may be used in accordance with embodimentsdisclosed herein. For example, the computer processors illustrated inFIGS. 3 and 4 may be used as host processors associated with matrixprocessing systems (e.g., host processor 260 in matrix processing system200 of FIG. 2A), or as processors associated with other componentsand/or devices discussed throughout this disclosure (e.g., processorsassociated with components in system 100 of FIG. 1). Other processor andsystem designs and configurations known in the art for laptops,desktops, handheld PCs, personal digital assistants, engineeringworkstations, servers, network devices, network hubs, switches, embeddedprocessors, digital signal processors (DSPs), graphics devices, videogame devices, set-top boxes, micro controllers, cell phones, portablemedia players, hand held devices, and various other electronic devices,are also suitable. In general, a huge variety of systems or electronicdevices capable of incorporating a processor and/or other executionlogic as disclosed herein are generally suitable.

FIG. 3 illustrates a block diagram for an example embodiment of aprocessor 300. Processor 300 is an example of a type of hardware devicethat can be used in connection with the embodiments described throughoutthis disclosure. Processor 300 may be any type of processor, such as amicroprocessor, an embedded processor, a digital signal processor (DSP),a network processor, a multi-core processor, a single core processor, orother device to execute code. Although only one processor 300 isillustrated in FIG. 3, a processing element may alternatively includemore than one of processor 300 illustrated in FIG. 3. Processor 300 maybe a single-threaded core or, for at least one embodiment, the processor300 may be multi-threaded in that it may include more than one hardwarethread context (or “logical processor”) per core.

FIG. 3 also illustrates a memory 302 coupled to processor 300 inaccordance with an embodiment. Memory 302 may be any of a wide varietyof memories (including various layers of memory hierarchy) as are knownor otherwise available to those of skill in the art. Such memoryelements can include, but are not limited to, random access memory(RAM), read only memory (ROM), logic blocks of a field programmable gatearray (FPGA), erasable programmable read only memory (EPROM), andelectrically erasable programmable ROM (EEPROM).

Processor 300 can execute any type of instructions associated withalgorithms, processes, or operations detailed herein. Generally,processor 300 can transform an element or an article (e.g., data) fromone state or thing to another state or thing.

Code 304, which may be one or more instructions to be executed byprocessor 300, may be stored in memory 302, or may be stored insoftware, hardware, firmware, or any suitable combination thereof, or inany other internal or external component, device, element, or objectwhere appropriate and based on particular needs. In one example,processor 300 can follow a program sequence of instructions indicated bycode 304. Each instruction enters a front-end logic 306 and is processedby one or more decoders 308. The decoder may generate, as its output, amicro operation such as a fixed width micro operation in a predefinedformat, or may generate other instructions, microinstructions, orcontrol signals that reflect the original code instruction. Front-endlogic 306 may also include register renaming logic and scheduling logic,which generally allocate resources and queue the operation correspondingto the instruction for execution.

Processor 300 can also include execution logic 314 having a set ofexecution units 316 a, 316 b, 316 n, etc. Some embodiments may include anumber of execution units dedicated to specific functions or sets offunctions. Other embodiments may include only one execution unit or oneexecution unit that can perform a particular function. Execution logic314 performs the operations specified by code instructions.

After completion of execution of the operations specified by the codeinstructions, back-end logic 318 can retire the instructions of code304. In one embodiment, processor 300 allows out of order execution butrequires in order retirement of instructions. Retirement logic 320 maytake a variety of known forms (e.g., re-order buffers or the like). Inthis manner, processor 300 is transformed during execution of code 304,at least in terms of the output generated by the decoder, hardwareregisters and tables utilized by register renaming logic 310, and anyregisters (not shown) modified by execution logic 314.

Although not shown in FIG. 3, a processing element may include otherelements on a chip with processor 300. For example, a processing elementmay include memory control logic along with processor 300. Theprocessing element may include I/O control logic and/or may include I/Ocontrol logic integrated with memory control logic. The processingelement may also include one or more caches. In some embodiments,non-volatile memory (such as flash memory or fuses) may also be includedon the chip with processor 300.

FIG. 4 illustrates a block diagram for an example embodiment of amultiprocessor 400. As shown in FIG. 4, multiprocessor system 400 is apoint-to-point interconnect system, and includes a first processor 470and a second processor 480 coupled via a point-to-point interconnect450. In some embodiments, each of processors 470 and 480 may be someversion of processor 300 of FIG. 3.

Processors 470 and 480 are shown including integrated memory controller(IMC) units 472 and 482, respectively. Processor 470 also includes aspart of its bus controller units point-to-point (P-P) interfaces 476 and478; similarly, second processor 480 includes P-P interfaces 486 and488. Processors 470, 480 may exchange information via a point-to-point(P-P) interface 450 using P-P interface circuits 478, 488. As shown inFIG. 4, IMCs 472 and 482 couple the processors to respective memories,namely a memory 432 and a memory 434, which may be portions of mainmemory locally attached to the respective processors.

Processors 470, 480 may each exchange information with a chipset 490 viaindividual P-P interfaces 452, 454 using point to point interfacecircuits 476, 494, 486, 498. Chipset 490 may optionally exchangeinformation with the coprocessor 438 via a high-performance interface439. In one embodiment, the coprocessor 438 is a special-purposeprocessor, such as, for example, a high-throughput MIC processor, anetwork or communication processor, compression engine, graphicsprocessor, GPGPU, embedded processor, matrix processor, or the like.

A shared cache (not shown) may be included in either processor oroutside of both processors, yet connected with the processors via P-Pinterconnect, such that either or both processors' local cacheinformation may be stored in the shared cache if a processor is placedinto a low power mode.

Chipset 490 may be coupled to a first bus 416 via an interface 496. Inone embodiment, first bus 416 may be a Peripheral Component Interconnect(PCI) bus, or a bus such as a PCI Express bus or another thirdgeneration I/O interconnect bus, although the scope of this disclosureis not so limited.

As shown in FIG. 4, various I/O devices 414 may be coupled to first bus416, along with a bus bridge 418 which couples first bus 416 to a secondbus 420. In one embodiment, one or more additional processor(s) 415,such as coprocessors, high-throughput MIC processors, GPGPU's,accelerators (such as, e.g., graphics accelerators or digital signalprocessing (DSP) units), matrix processors, field programmable gatearrays, or any other processor, are coupled to first bus 416. In oneembodiment, second bus 420 may be a low pin count (LPC) bus. Variousdevices may be coupled to a second bus 420 including, for example, akeyboard and/or mouse 422, communication devices 427 and a storage unit428 such as a disk drive or other mass storage device which may includeinstructions/code and data 430, in one embodiment. Further, an audio I/O424 may be coupled to the second bus 420. Note that other architecturesare possible. For example, instead of the point-to-point architecture ofFIG. 4, a system may implement a multi-drop bus or other sucharchitecture.

All or part of any component of FIG. 4 may be implemented as a separateor stand-alone component or chip, or may be integrated with othercomponents or chips, such as a system-on-a-chip (SoC) that integratesvarious computer components into a single chip.

Embodiments of the mechanisms disclosed herein may be implemented inhardware, software, firmware, or a combination of such implementationapproaches. Certain embodiments may be implemented as computer programsor program code executing on programmable systems comprising at leastone processor, a storage system (including volatile and non-volatilememory and/or storage elements), at least one input device, and at leastone output device.

Program code, such as code 430 illustrated in FIG. 4, may be applied toinput instructions to perform the functions described herein andgenerate output information. The output information may be applied toone or more output devices, in known fashion. For purposes of thisapplication, a processing system includes any system that has aprocessor, such as, for example; a digital signal processor (DSP), amicrocontroller, an application specific integrated circuit (ASIC), or amicroprocessor.

The program code may be implemented in a high level procedural or objectoriented programming language to communicate with a processing system.The program code may also be implemented in assembly or machinelanguage, if desired. In fact, the mechanisms described herein are notlimited in scope to any particular programming language. In any case,the language may be a compiled or interpreted language.

One or more aspects of at least one embodiment may be implemented byrepresentative instructions stored on a machine-readable medium whichrepresents various logic within the processor, which when read by amachine causes the machine to fabricate logic to perform the techniquesdescribed herein. Such representations, known as “IP cores” may bestored on a tangible, machine readable medium and supplied to variouscustomers or manufacturing facilities to load into the fabricationmachines that actually make the logic or processor.

Such machine-readable storage media may include, without limitation,non-transitory, tangible arrangements of articles manufactured or formedby a machine or device, including storage media such as hard disks, anyother type of disk including floppy disks, optical disks, compact diskread-only memories (CD-ROMs), compact disk rewritable's (CD-RWs), andmagneto-optical disks, semiconductor devices such as read-only memories(ROMs), random access memories (RAMs) such as dynamic random accessmemories (DRAMs), static random access memories (SRAMs), erasableprogrammable read-only memories (EPROMs), flash memories, electricallyerasable programmable read-only memories (EEPROMs), phase change memory(PCM), magnetic or optical cards, or any other type of media suitablefor storing electronic instructions.

Accordingly, embodiments of this disclosure also include non-transitory,tangible machine-readable media containing instructions or containingdesign data, such as Hardware Description Language (HDL), which definesstructures, circuits, apparatuses, processors and/or system featuresdescribed herein. Such embodiments may also be referred to as programproducts.

Distributed Convolution Operations

FIG. 5 illustrates an example convolution operation 500. A convolutionoperation may be used, for example, for image processing, such as imageprocessing used by an artificial neural network to provide computervision artificial intelligence and machine learning capabilities. Forexample, in some embodiments, convolution operations may be used toimplement the fundamental operations of an artificial neural network,including forward propagation, backward propagation, and weight updates.A convolution operation used for image processing may involve applying afilter to an image. The filter (which may also be referred to as a“kernel”) may be used to modify the image (e.g., applying visualeffects), detect certain features in the image (e.g., facial recognitionor identification of other objects), and so forth. In some embodiments,the filter may be smaller than the image, and the convolution operationmay be performed by moving the filter throughout the image and applyingthe filter at each location.

In the illustrated embodiment, for example, a convolution operation 500is performed on an image 502 using a filter 504, resulting in aconvolution result 506. In some embodiments, the image 502, filter 504,and result 506 of a convolution operation 500 may be represented asmatrices. For example, an image may be represented by a matrix whoseelements correspond to each pixel of the image. For example, in someembodiments, a black and white image may be represented by atwo-dimensional (2D) matrix with dimensions corresponding to the height(H) and width (W) of the image. As another example, a color image (e.g.,image 502) may be represented by a three-dimensional (3D) matrix withdimensions corresponding to the number of channels (C), height (H), andwidth (W) of the image. The channels of the image, for example, may beused to define the color of each pixel in the image. For example, insome embodiments, a color image may include three RGB channels to definethe color of each pixel (e.g., a red channel, a green channel, and ablue channel). Similarly, a filter (e.g., filter 504) for a color imagemay be represented by a 3D matrix with dimensions corresponding to thenumber of channels (C), filter height (R), and filter width (S). Inthese embodiments, a convolution operation 500 may be performed bymoving the filter 504 throughout the image 502 and computing the dotproduct between the filter 504 and the various portions of the image502. For example, in some embodiments, the filter 504 may be moved alongthe height and width of the image 502 using a certain stride orinterval, the dot product may be computed at each location, and theresult may be stored in the corresponding location of a result matrix506. The result matrix 506, for example, may be represented by a 3Dmatrix with dimensions corresponding to the number of channels (C),output height (P), and output width (Q).

Moreover, in some embodiments, when convolution operations need to beperformed on multiple images and using multiple filters, the images maybe processed together to increase processing efficiency. Thus, in someembodiments, a collection of images may be represented using afour-dimensional (4D) matrix, with dimensions corresponding to thenumber of channels (C), image height (H), image width (W), and number ofimages (N). Similarly, a collection of filters may be represented usinga 4D matrix, with dimensions corresponding to the number of filters (K),number of channels (C), filter height (R), and filter width (S).Accordingly, multiple convolution operations may then be performed usingthe 4D matrices that are used to represent the images and filters. Thecollective results of the convolution operations may be representedusing a 4D matrix, with dimensions corresponding to number of filters(K), output height (P), output width (Q), and number of images (N).

FIGS. 6 and 7 illustrate example neural network operations associatedwith convolutions. As described above in connection with FIG. 5, aconvolution operation can be used for image processing, for example, byapplying a filter to an image in order to modify the image (e.g.,applying visual effects), detect certain features in the image (e.g.,facial recognition or identification of other objects), and so forth.Moreover, in some embodiments, convolution operations can be used forimage processing in an artificial neural network, for example, toprovide computer vision artificial intelligence and machine learningcapabilities. For example, in some embodiments, the fundamentaloperations of an artificial neural network (e.g., forward propagation,backward propagation, and weight updates) can be implemented forconvolution operations. These fundamental neural network operations maybe used, in some embodiments, to train a neural network in order toprovide machine learning functionality. For example, a forwardpropagation operation may include propagating a particular input througha neural network in order to generate a corresponding output. The inputto the forward propagation operation may be a training pattern with aknown or expected output. A backward propagation operation may then beused to determine the error associated with the forward propagationoperation based on the difference or delta between the calculated outputand the expected output of the forward propagation operation. A weightupdate operation may then be used to determine updated weight values inorder to minimize the associated error. In some embodiments, theseneural network operations may be implemented for convolution operations.For example, in some embodiments, these neural network operations may beimplemented using the following formulas (where the asterisk (*)represents each respective operation):

forward propagation: IFM[CHW×N]*FILTER[CRS×K]=OFM[KPQ×N]

backward propagation: IFM[KPQ×N]*FILTER[KRS×C]=OFM[CHW×N]

weight update: IFM1[CHW×N]*IFM2[KPQ×N]=OFM[CRS×K]

In some embodiments, the example operations illustrated by FIGS. 6 and 7may be performed using a matrix processing architecture, such as thematrix processing architecture of FIGS. 2A-2C.

FIGS. 6A-G illustrate an example forward propagation operation in aneural network. The illustrated forward propagation operation isimplemented using the following formula (where the asterisk (*)represents forward propagation): IFM[CHW×N]*FILTER[CRS×K]=OFM[KPQ×N].Moreover, although not illustrated, a backward propagation operation maybe implemented in a manner similar to the forward propagation operationdiscussed throughout FIGS. 6A-G, by replacing the forward propagationformula with a formula for backward propagation, such as the followingformula (where the asterisk (*) represents backward propagation):IFM[KPQ×N]*FILTER[KRS×C]=OFM[CHW×N].

In some embodiments, forward propagation can be implemented forconvolution operations. For example, the illustrated forward propagationoperation is implemented by performing convolutions using an inputfeature matrix (IFM) 602 and a filter 604 to generate an output featurematrix (OFM) 606. In some embodiments, IFM 602 may correspond to acollection of images represented using a four-dimensional (4D) matrix,with dimensions corresponding to the number of channels (C), imageheight (H), image width (W), and number of images (N). In someembodiments, however, IFM 602 may need to be stored in 2D memory (e.g.,when using matrix processing architectures that store matrix operandsusing 2D memory components). Accordingly, because IFM 602 is a 4Dmatrix, its dimensions may need to be rearranged in order to store it in2D memory. For example, in some embodiments, IFM 602 could be stored in2D memory by treating the channels (C), height (H), and width (W) as onedimension, and treating the number of images (N) as another dimension(e.g., arranging the dimensions of IFM 602 as CHW×N).

Similarly, filter 604 may correspond to a collection of filtersrepresented using a four-dimensional (4D) matrix, with dimensionscorresponding to the number of filters (K), number of channels (C),filter height (R), and filter width (S). Moreover, because filter 604 isa 4D matrix, its dimensions may need to be rearranged in order to storeit in 2D memory. For example, in some embodiments, filter 604 could bestored in 2D memory by treating the channels (C), filter height (R), andfilter width (S) as one dimension, and treating the number of filters(K) as another dimension (e.g., arranging the dimensions of filter 604as CRS×K).

OFM 606 may correspond to the result of the convolution operation, andmay be represented using a four-dimensional (4D) matrix with dimensionscorresponding to the number of filters (K), output height (P), outputwidth (Q), and number of images (N). Moreover, because OFM 606 is a 4Dmatrix, its dimensions may need to be rearranged in order to store it in2D memory. For example, in some embodiments, OFM 606 could be stored in2D memory by treating the number of filters (K), output height (P), andoutput width (Q) as one dimension, and treating the number of images (N)as another dimension (e.g., arranging the dimensions of OFM 606 asKPQ×N).

FIG. 6A illustrates the process of partitioning the forward propagationoperation among the available processing resources. For example, in someembodiments, the matrix operands of a forward propagation operation maybe partitioned in order to distribute the forward propagation operationacross a variable number of processing resources, as describedthroughout this disclosure.

In some embodiments, the operands of a forward propagation operation maybe partitioned into a number of partitions corresponding to the numberof available processing resources. For example, if there are Pprocessing resources available to perform the operation, the inputfeature matrix (IFM) 602 and filter 604 may be partitioned into Ppartitions. Moreover, in some embodiments, the P partitions may beacross any of the various dimensions of the matrix operands, such as thechannels (C), images (N), and/or filters (K). Each partition may then bedistributed to a particular processing resource, as described throughoutthis disclosure.

In the illustrated example, the matrix operands are partitioned fordistribution across four processing resources. Accordingly, IFM 602 andfilter 604 are partitioned into four partitions p₁-p₄ (designated bylabel 608) corresponding to the four processing resources. Moreover, insome embodiments, partitions p₁-p₄ of filter 604 may be furtherpartitioned into virtual partitions v₁-v₄ (designated by label 609).Virtual partitions v₁-v₄, for example, may simply be furthersub-partitions of partitions p₁-p₄, which are respectively used indifferent stages of a forward propagation operation. Moreover, thepartitions of IFM 602 and filter 604 are across the channels (C) andfilters (K) dimensions. Each partition p₁-p₄ may then be distributed toa particular matrix processing resource. For example, partition p₁ ofIFM 602 and filter 604 may be distributed to a first matrix processingresource, partition p₂ of IFM 602 and filter 604 may be distributed to asecond matrix processing resource, and so forth.

Moreover, in some embodiments, matrix operands may be partitionedhierarchically based on the hierarchical arrangement of processingresources. For example, as described above regarding the matrixprocessing architecture of FIGS. 2A-2C, matrix processing system 200 mayinclude a hierarchy of processing resources 210, including multiplematrix processing chips 220, multiple high bandwidth memory (HBM)modules 240 on each matrix processing chip 220, multiple matrixprocessing clusters 230 on each matrix processing chip 220, and/ormultiple matrix processing units (MPUs) 234 on each matrix processingcluster 230. Accordingly, in some embodiments, matrix operands may bepartitioned at the multi-chip level, the multi-HBM level, and/or themulti-cluster level.

At the multi-chip level, the matrix operands may initially bepartitioned based on the number of available matrix processing chips(e.g., matrix processing chips 220 of FIG. 2A). The partitions at themulti-chip level may be across any of the various dimensions of thematrix operands, such as the channels (C), images (N), and/or filters(K) dimensions. Each partition, and the associated partial matrixoperations, may then be distributed to a particular matrix processingchip.

At the multi-HBM level, the partition and partial matrix operationsdistributed to a particular matrix processing chip may then be similarlypartitioned and distributed across various “logical processing nodes” ofthat matrix processing chip. A “logical processing node” of a matrixprocessing chip may include, for example, a group of matrix processingclusters and an associated high-bandwidth memory (HBM) module. Forexample, matrix processing chip 220 of FIG. 2B includes twelve matrixprocessing clusters 230 and four high bandwidth memory (HBM) modules240. Thus, matrix processing chip 220 may be treated as having fourlogical processing nodes, where each logical processing node includesthree matrix processing clusters 230 and an associated high bandwidthmemory (HBM) module 240. Accordingly, at the multi-HBM level for a chipsuch as matrix processing chip 220, the partition and partial matrixoperations distributed to that chip may then be similarly partitionedand distributed across the four logical processing nodes of that matrixprocessing chip. The partitions at the multi-HBM level may be across anyof the various dimensions of the matrix operands, such as the channels(C), images (N), and/or filters (K) dimensions.

At the multi-cluster level, the partition and partial matrix operationsdistributed to a particular logical processing node may then besimilarly partitioned and distributed across the matrix processingclusters of that logical processing node (e.g., a group of three matrixprocessing clusters 230 in FIG. 2B), and across the matrix processingunits (MPUs) of each matrix processing cluster (e.g., matrix processingunits (MPUs) 234 of FIG. 2C). The partitions at the multi-cluster levelmay be across any of the various dimensions of the matrix operands, suchas the channels (C), and/or filters (K). Moreover, at the multi-clusterlevel, the partial matrix operations may be distributed across theheight (P) and width (Q) of the output feature matrix (OFM) 606. Forexample, in some embodiments, a logical processing node may includethree matrix processing clusters, and each matrix processing cluster mayinclude two matrix processing units (MPUs). Accordingly, a partialmatrix operation distributed to the logical processing node may bedistributed to the three matrix processing clusters across the height(P) of OFM 606, and the partial matrix operation distributed to eachmatrix processing cluster may then be distributed to the two matrixprocessing units (MPUs) across the width (Q) of OFM 606.

The forward propagation operation may then be performed as described inconnection with FIGS. 6B-6G.

FIG. 6B illustrates one of four partial calculations that are performedin parallel to determine the result of the forward propagationoperation. For example, the result of the forward propagation operationis determined by performing various partial calculations that are eachused to calculate a partial result of the forward propagation operation.For example, when the forward propagation operation is complete, eachpartial result of the forward propagation operation will be stored inpartitions p₁-p₄ of output feature matrix (OFM) 606, as illustrated inFIG. 6B. For example, as illustrated in FIG. 6B, partition p₁ of OFM 606corresponds to partial result ΔK₀PQ×N; partition p₂ of OFM 606corresponds to partial result ΔK₁PQ×N; partition p₃ of OFM 606corresponds to partial result ΔK₂PQ×N; and partition p₄ of OFM 606corresponds to partial result ΔK₃PQ×N.

The partial results of OFM 606 are determined using the followingpartial calculations:

-   -   1^(st) partial calculation: partial result ΔK₀PQ×N (partition p₁        of OFM 606)=convolution of IFM 602 and virtual partition v₁ of        filter 604;    -   2^(nd) partial calculation: partial result ΔK₁PQ×N (partition p₂        of OFM 606)=convolution of IFM 602 and virtual partition v₂ of        filter 604;    -   3^(rd) partial calculation: partial result ΔK₂PQ×N (partition p₃        of OFM 606)=convolution of IFM 602 and virtual partition v₃ of        filter 604; and    -   4^(th) partial calculation: partial result ΔK₃PQ×N (partition p₄        of OFM 606)=convolution of IFM 602 and virtual partition v₄ of        filter 604.

FIG. 6B illustrates the 1^(st) partial calculation above, which is usedto determine the partial result corresponding to partition p₁ of OFM 606(e.g., partial result ΔK₀PQ×N). For example, as illustrated in FIG. 6B,the 1^(st) partial calculation is a convolution of input feature matrix(IFM) 602 and the first virtual partition v₁ of filter 604, and theresult of the calculation is the partial result corresponding topartition p₁ of OFM 606 (e.g., partial result ΔK₀PQ×N).

In the illustrated example, the 1^(st) partial calculation (e.g., forthe partial result corresponding to partition p₁ of OFM 606) is brokendown as the sum of four sub-convolutions s₁-s₄ (where the asterisks (*)represent a convolution operation):

s₁: ΔC₀HW×N*ΔC₀RS×ΔK₀

s₂: ΔC₁HW×N*ΔC₁RS×ΔK₀

s₃ : ΔC₂HW×N*ΔC₂RS×ΔK₀

s₄: ΔC₃HW×N*ΔC₃RS×ΔK₀

These four sub-convolutions s₁-s₄ are then performed in four stages, asdescribed further in connection with FIGS. 6C-6F. Moreover, although notillustrated throughout FIGS. 6B-6F, the remaining partial calculationsidentified above (e.g., the 2^(nd)-4^(th) partial calculations for thepartial results corresponding to partitions p₂-p₄ of OFM 606) may beexecuted in parallel and in a similar manner as the 1^(st) partialcalculation.

For example, in the first stage, sub-convolution s₄ of the 1^(st)partial calculation is performed by a first processing resource.Moreover, during this stage, the other processing resources may beperforming sub-convolutions associated with the other partialcalculations identified above. In the second stage, sub-convolution s₃of the 1^(st) partial calculation is performed by a second processingresource, and while that sub-convolution is being performed, the resultof sub-convolution s₄ is transmitted from the first processing resourceto the second processing resource. When the second processing resourcecompletes sub-convolution s₃, it calculates the sum of s₄ and s₃.Moreover, during this stage, the other processing resources may beperforming similar operations associated with the other partialcalculations identified above. In the third stage, sub-convolution s₂ ofthe 1^(st) partial calculation is performed by a third processingresource, and while that sub-convolution is being performed, the sum ofs₄ and s₃ is transmitted from the second processing resource to thethird processing resource. When the third processing resource completessub-convolution s₂, it calculates the sum of s₄, s₃, and s₂. Moreover,during this stage, the other processing resources may be performingsimilar operations associated with the other partial calculationsidentified above. In the fourth stage, sub-convolution s₁ of the 1^(st)partial calculation is performed by a fourth processing resource, andwhile that sub-convolution is being performed, the sum of s₄, s₃, and s₂is transmitted from the third processing resource to the fourthprocessing resource. When the fourth processing resource completessub-convolution sl, it calculates the sum of s₄, s₃, s₂, and s₁, whichis the final result of the 1^(st) partial calculation (e.g., the partialresult corresponding to partition p₁ of OFM 606). Similarly, during thisstage, the other processing resources may be performing similaroperations associated with the other partial calculations identifiedabove, and thus may obtain the partial results corresponding topartitions p₂-p₄ of OFM 606.

FIG. 6C illustrates stage 1 of the 1^(st) partial calculation from FIG.6B. As discussed above in connection with FIG. 6A, the matrix operandshave been partitioned into four partitions corresponding to the fouravailable processing resources. In the illustrated example of FIG. 6C,the four available processing resources are processing resources 610-1to 610-4. Processing resources 610, for example, could be any of theprocessing resources 210 of matrix processing system 200 from FIGS.2A-2C, such as matrix processing chips 220, logical processing nodes,and/or matrix processing clusters 230, among other examples. Forexample, at the multi-chip level, processing resources 610 could bematrix processing chips; at the multi-HBM level, processing resources610 could be logical processing nodes (e.g., groups of matrix processingclusters 230 and an associated HBM module 240); and at the multi-clusterlevel, processing resources 610 could be matrix processing clusters.

Although not illustrated, partitions p₁-p₄ of the matrix operands havebeen distributed across processing resources 610-1 to 610-4 (e.g., p₁ toprocessing resource 610-1, p₂ to processing resource 610-2, and soforth), as described above in connection with FIG. 6A. Accordingly,partition p₄ of the matrix operands has been distributed to processingresource 610-4.

In the illustrated example of stage 1, processing resource 610-4performs sub-convolution s₄ (e.g., ΔC₃HW×N*ΔC₃RS×ΔK₀) of the 1^(st)partial calculation. Moreover, although not illustrated, the processingresources may be performing similar stage 1 operations associated withthe other partial calculations identified above in connection with FIG.6B (e.g., the 2^(nd)-4^(th) partial calculations).

FIG. 6D illustrates stage 2 of the 1^(st) partial calculation from FIG.6B. As discussed above, the matrix operands have been partitioned intofour partitions p₁-p₄, which have been distributed to the four availableprocessing resources 610. Accordingly, although not illustrated,partition p₃ of the matrix operands has been distributed to processingresource 610-3.

In the illustrated example of stage 2, processing resource 610-3performs sub-convolution s₃ (e.g., ΔC₂HW×N*ΔC₂RS×ΔK₀) of the 1^(st)partial calculation. Moreover, while processing resource 610-3 isperforming sub-convolution s₃, processing resource 610-4 transmits theresult of sub-convolution s₄ (which was computed during the previousstage) to processing resource 610-3 (denoted by label 615 a). Moreover,although not illustrated, the processing resources may be performingsimilar stage 2 operations associated with the other partialcalculations identified above in connection with FIG. 6B (e.g., the 2^(nd)-4^(th) partial calculations).

FIG. 6E illustrates stage 3 of the 1^(st) partial calculation from FIG.6B. As discussed above, the matrix operands have been partitioned intofour partitions p₁-p₄, which have been distributed to the four availableprocessing resources 610. Accordingly, although not illustrated,partition p₂ of the matrix operands has been distributed to processingresource 610-2.

In the illustrated example of stage 3, processing resource 610-2performs sub-convolution s₂ (e.g., ΔC₁HW×N* ΔC₁RS×ΔK₀) of the 1^(st)partial calculation. Moreover, while processing resource 610-2 isperforming sub-convolution s₂, processing resource 610-3 transmits thesum of sub-convolutions s₄ and s₃ (or s₄+s₃) to processing resource610-2 (denoted by label 615 b). Moreover, although not illustrated, theprocessing resources may be performing similar stage 3 operationsassociated with the other partial calculations identified above inconnection with FIG. 6B (e.g., the 2^(nd)-4^(th) partial calculations).

FIG. 6F illustrates stage 4 of the 1^(st) partial calculation from FIG.6B. As discussed above, the matrix operands have been partitioned intofour partitions p₁-p₄, which have been distributed to the four availableprocessing resources 610. Accordingly, although not illustrated,partition p₁ of the matrix operands has been distributed to processingresource 610-1.

In the illustrated example of stage 4, processing resource 610-1performs sub-convolution si (e.g., ΔC₀HW×N* ΔC₀RS×ΔK₀) of the 1^(st)partial calculation. Moreover, while processing resource 610-1 isperforming sub-convolution s₁, processing resource 610-2 transmits thesum of sub-convolutions s₄, s₃, and s₂ (or s₄+s₃+s₂) to processingresource 610-1 (denoted by label 615 c). Moreover, although notillustrated, the processing resources may be performing similar stage 4operations associated with the other partial calculations identifiedabove in connection with FIG. 6B (e.g., the 2^(nd)-4^(th) partialcalculations).

FIG. 6G illustrates the result of the forward propagation operationafter all stages have been completed.

After all stages are complete, processing resource 610-1 contains thepartial result of the 1^(st) partial calculation from FIG. 6B. Forexample, processing resource 610-1 contains the sum of sub-convolutionss₄, s₃, s₂, and s₁ (or s₄+s₃+s₂+s₁) of the 1^(st) partial calculation,which is the partial result corresponding to the first partition p₁ ofOFM 606 in FIG. 6A (e.g., ΔK₀PQ×N). Moreover, although not illustrated,during stages 1-4 of FIGS. 6C-6F, processing resources 610 performedsimilar operations in parallel for the other partial calculationsidentified above in connection with FIG. 6B (e.g., the 2 ^(nd)-4^(th)partial calculations).

Accordingly, when all stages have been completed, each processingresource 610 contains one of the partial results of OFM 606 from FIG.6A. For example, as shown in the illustrated example of FIG. 6G,processing resource 610-1 has the partial result (ΔK₀PQ×N) correspondingto the first partition p₁ of OFM 606 in FIG. 6A; processing resource610-2 has the partial result (ΔK₁PQ×N) corresponding to the secondpartition p₂ of OFM 606 in FIG. 6A; processing resource 610-3 has thepartial result (ΔK₂PQ×N) corresponding to the third partition p₃ of OFM606 in FIG. 6A; and processing resource 610-4 has the partial result(ΔK₃PQ×N) corresponding to the fourth partition p₄ of OFM 606 in FIG.6A. Accordingly, the result of the forward propagation operation (e.g.,OFM 606) now includes all four partial results, and thus the forwardpropagation operation is complete.

FIGS. 7A-F illustrate an example weight update operation in a neuralnetwork. The illustrated weight update operation is implemented usingthe following formula (where the asterisk (*) represents a weight updateoperation): IFM1[CHW×N]*IFM2[KPQ×N]=OFM[CRS×K]. Thus, in the illustratedweight update operation, a weight update is performed using a firstinput feature matrix 701 (IFM1) and a second input feature matrix 702(IFM2) to generate an output feature matrix 703. In some embodiments,for example, IFM1 701 may correspond to the output of a backwardpropagation operation, IFM2 702 may correspond to the output of aforward propagation operation, and OFM 703 may correspond to an updatedweight matrix with adjusted weight values to minimize the errorassociated with forward propagation operations. For example, in someembodiments, the illustrated weight update operation may be used togenerate an updated filter for convolutions associated with forwardpropagation operations in a neural network.

FIG. 7A illustrates the process of partitioning the weight updateoperation among the available processing resources. For example, in someembodiments, the matrix operands of a weight update operation may bepartitioned in order to distribute the weight update operation across avariable number of processing resources, as described throughout thisdisclosure.

In some embodiments, the operands of a weight update operation may bepartitioned into a number of partitions corresponding to the number ofavailable processing resources. For example, if there are P processingresources available to perform the weight update operation, IFM1 701 andIFM2 702 may be partitioned into P partitions. Moreover, in someembodiments, the P partitions may be across any of the variousdimensions of the matrix operands, such as the channels (C), images (N),and/or filters (K) dimensions. Each partition may then be distributed toa particular processing resource, as described throughout thisdisclosure.

In the illustrated example, the matrix operands are partitioned fordistribution across four processing resources. Accordingly, IFM1 701 andIFM2 702 are partitioned into four partitions p₁-p₄ (designated by label708) corresponding to the four processing resources. Moreover, thepartitions of IFM1 701 and IFM2 702 are across the channels (C) andfilters (K) dimensions. Each partition p₁-p₄ may then be distributed toa particular matrix processing resource. For example, partition p₁ ofIFM1 701 and IFM2 702 may be distributed to a first matrix processingresource, partition p₂ of IFM1 701 and IFM2 702 may be distributed to asecond matrix processing resource, and so forth.

Moreover, each processing resource then performs various stages ofpartial matrix operations to compute various partial results of theoutput feature matrix (OFM) 703. The partial results from these partialmatrix operations are stored in partitions p₁-p₄ (and virtual partitionsv₁-v₄) of OFM 703, as illustrated in FIG. 7A. For example, in theillustrated example, OFM 703 is partitioned into partitions p₁-p₄ andvirtual partitions v₁-v₄ (as designated by labels 708 and 709).Partitions p₁-p₄ of OFM 703 are each stored by a different processingresource, while virtual partitions v₁-v₄ are simply furthersub-partitions of a partition p₁-p₄ stored by a particular processingresource.

Moreover, in some embodiments, matrix operands may be partitioned anddistributed hierarchically based on the hierarchical arrangement ofprocessing resources, as described above in connection with FIG. 6A. Forexample, at the multi-chip level, the matrix operation and operands maybe partitioned and distributed across the available matrix processingchips. At the multi-HBM level, partial matrix operations and operandsdistributed to a particular matrix processing chip may be partitionedand distributed across the “logical processing nodes” of that matrixprocessing chip. Finally, at the multi-cluster level, partial matrixoperations and operands distributed to a particular logical processingnode may be partitioned and distributed across the matrix processingclusters of the logical processing node, and/or across the matrixprocessing units (MPUs) of each matrix processing cluster. Moreover, thepartitions of the matrix operands may be across any of the variousdimensions of the matrix operands, such as the channels (C), images (N),and/or filters (K) dimensions. In addition, the partial matrixoperations may be distributed across the height (P) and width (Q) ofoutput feature matrix (OFM) 703.

The weight update operation may then be performed as described inconnection with FIGS. 7B-7F.

FIG. 7B illustrates one of four partial weight update operations thatare performed in parallel to determine the result of the weight updateoperation. For example, the result of the weight update operation isdetermined by performing various partial weight update operations thatare each used to calculate a partial result of the weight updateoperation. The partial results from these partial weight updateoperations are stored in partitions p₁-p₄ (and partitions v₁-v₄) ofoutput feature matrix (OFM) 703, as illustrated in FIG. 7B. For example,each partial weight update operation is further broken down into fourpartial matrix calculations, and the result of each partial matrixcalculation is stored in virtual partitions v₁-v₄ of a particularpartition p₁-p₄ of OFM 703. In the illustrated example, partitions p₁-p₄of OFM 703 are each stored by a different processing resource, whilevirtual partitions v₁-v₄ are simply further sub-partitions of apartition p₁-p₄ stored by a particular processing resource. When thepartial weight update operations are complete, the result of the weightupdate operation will be stored in OFM 703, as illustrated in FIG. 7B.

The result of the weight update operation is determined using thefollowing partial weight update operations (where an asterisk (*)represents a partial weight update operation):

-   -   1^(st) partial weight update operation: ΔC₀HW×N (p₁ of IFM1        701)*KPQ×N (IFM2 702)=ΔC₀RS×K (p₁ of OFM 703);    -   2^(nd) partial weight update operation: ΔC₁HW×N (p₂ of IFM1        701)*KPQ×N (IFM2 702)=ΔC₁RS×K (p₂ of OFM 703);    -   3^(rd) partial weight update operation: ΔC₂HW×N (p₃ of IFM1        701)*KPQ×N (IFM2 702)=ΔC₂RS×K (p₃ of OFM 703); and    -   4^(th) partial weight update operation: ΔC₃HW×N (p₄ of IFM1        701)*KPQ×N (IFM2 702)=ΔC₃RS×K (p₄ of OFM 703).

FIG. 7B illustrates the 1St partial weight update operation above. Forexample, as illustrated in FIG. 7B, the 1^(st) partial weight updateoperation is implemented using partial input matrix ΔC₀HW×N (e.g.,partition p₁ of IFM1 701) and input matrix KPQ×N (e.g., IFM2 702) togenerate partial result matrix ΔC₀RS×K (e.g., the partial resultcorresponding to partition p₁ of OFM 703). Moreover, the 1^(st) partialweight update operation is further broken down into four partial matrixcalculations, and the result of each partial matrix calculation isstored in virtual partitions v₁-v₄ of partition p₁ of OFM 703. Althoughnot illustrated, the remaining partial weight update operations(identified above as the 2^(nd)-4^(th) partial weight update operations)are each similarly broken down into four partial matrix calculations.

The entire weight update operation (including all associated partialweight update operations and partial matrix calculations) is thenperformed in four stages, as described further in connection with FIGS.7C-7F.

FIG. 7C illustrates stage 1 of the weight update operation. As discussedabove in connection with FIG. 7A, the matrix operands have beenpartitioned into four partitions p₁-p₄ corresponding to the fouravailable processing resources. Thus, each partition p₁-p₄ of IFM1 701and IFM2 702 has been distributed to a particular processing resource.For example, a first processing resource has partition p₁ of IFM1 701and IFM2 702, a second processing resource has partition p₂ of IFM1 701and IFM2 702, a third processing resource has partition p₃ of IFM1 701and IFM2 702, and a fourth processing resource has partition p₄ of IFM1701 and IFM2 702.

Accordingly, in stage 1 of the weight update operation, each processingresource performs a partial matrix calculation using its respectivepartitions of IFM1 701 and IFM2 702, as illustrated in FIG. 7C anddescribed further below. In some embodiments, for example, the partialmatrix calculation performed by each processing resource (represented byasterisks (*) in the discussion below) may be a matrix multiplicationoperation.

The first processing resource performs the following partial matrixcalculation using the matrix operands on partition p₁ of IFM1 701 andIFM2 702: ΔC₀HW×N*ΔK₀PQ×N=ΔC₀RS×ΔK₀. The result is stored in thecorresponding location of OFM 703 (e.g., on partition p₁,v₁ of OFM 703).

The second processing resource performs the following partial matrixcalculation using the matrix operands on partition p₂ of IFM1 701 andIFM2 702: ΔC₁HW×N*ΔK₁PQ×N=ΔC₁RS×ΔK₁. The result is stored in thecorresponding location of OFM 703 (e.g., on partition p₂,v₂ of OFM 703).

The third processing resource performs the following partial matrixcalculation using the matrix operands on partition p₃ of IFM1 701 andIFM2 702: ΔC₂HW×N*ΔK₂PQ×N=ΔC₂RS×ΔK₂. The result is stored in thecorresponding location of OFM 703 (e.g., on partition p₃,v₃ of OFM 703).

Finally, the fourth processing resource performs the following partialmatrix calculation using the matrix operands on partition p₄ of IFM1 701and IFM2 702: ΔC₃HW×N*ΔK₃PQ×N=ΔC₃RS×ΔK₃. The result is stored in thecorresponding location of OFM 703 (e.g., on partition p₄,v₄ of OFM 703).

Moreover, while the partial matrix calculations are being performed bythe processing resources in stage 1, each processing resourcesimultaneously sends and receives partial matrix operands to and fromits neighbor processing resources. For example, in some embodiments, theprocessing resources may be configured in a single-cyclical arrangement(e.g., with unidirectional communication between neighboring processingresources) or a dual-cyclical arrangement (e.g., with bi-directionalcommunication between neighboring processing resources). In asingle-cyclical configuration, each processing resource either sends to,or receives from, each neighbor processing resource. In a dual-cyclicalconfiguration, each processing resource may send and receive to and fromeach neighbor processing resource. Accordingly, for some operations, adual-cyclical configuration may reduce the latency for communicatingmatrix operands, thus avoiding any idle processing time.

Accordingly, using a cyclical configuration (e.g., single-cyclical,dual-cyclical, or any other cyclical-based configuration), thepartitions p₁-p₄ of IFM2 702 are shifted across the processing resourcesduring each stage of the weight update operation. In the illustratedexamples of FIGS. 7C-F, a single-cyclical configuration is used.Accordingly, each processing resource sends its partition px of IFM2 702to a neighbor processing resource, and receives a partition px of IFM2702 from another neighbor processing resource. In other embodiments, adual-cyclical configuration may be used, which may reduce the latency inhalf for communicating partial matrix operands for certain matrixoperations. For example, using a dual-cyclical approach, each processingresource sends its partition px of IFM2 702 to both of its neighborprocessing resources, and receives a partition p_(x) of IFM2 702 fromboth of its neighbor processing resources.

In this manner, during each stage of the weight update operation,partial matrix operands (e.g., partitions p₁-p₄ of IFM2 702) are shiftedacross the processing resources to and from their respective neighboringprocessing resource(s). For example, in FIG. 7C, the partial matrixoperands of IFM2 702 are shifted as follows:

-   -   The 4^(th) processing resource sends its partition of IFM2 702        (e.g., ΔK₃PQ×N) to the 3^(rd) processing resource (e.g., the        matrix operand in partition p₄ of IFM2 702 is shifted up to        partition p₃ of IFM2 702).    -   The 3^(rd) processing resource sends its partition of IFM2 702        (e.g., ΔK₂PQ×N) to the 2^(nd) processing resource (e.g., the        matrix operand in partition p₃ of IFM2 702 is shifted up to        partition p₂ of IFM2 702).    -   The 2^(nd) processing resource sends its partition of IFM2 702        (e.g., ΔK₁PQ×N) to the 1^(st) processing resource (e.g., the        matrix operand in partition p₂ of IFM2 702 is shifted up to        partition p₁ of IFM2 702).    -   The 1^(st) processing resource sends its partition of IFM2 702        (e.g., ΔK₀PQ×N) to the 4^(th) processing resource (e.g., the        matrix operand in partition p₁ of IFM2 702 is shifted down to        partition p₄ of IFM2 702).

Each processing resource may then use the partial matrix operandsreceived from neighboring processing resource(s) in subsequent stages,as described below in connection with FIGS. 7D-F.

FIG. 7D illustrates stage 2 of the weight update operation. As describedabove in connection with stage 1 of FIG. 7C, the partitions of IFM2 702were shifted across the processing resources during stage 1 of theweight update operation. Accordingly, in stage 2 of the weight updateoperation, each processing resource performs a partial matrixcalculation using its respective partitions of IFM1 701 and IFM2 702, asillustrated in FIG. 7D and described further below. In some embodiments,for example, the partial matrix calculation performed by each processingresource (represented by asterisks (*) in the discussion below) may be amatrix multiplication operation.

The first processing resource performs the following partial matrixcalculation using the matrix operands on partition p₁ of IFM1 701 andIFM2 702: ΔC₀HW×N*ΔK₁PQ×N=ΔC₀RS×ΔK₁. The result is stored in thecorresponding location of OFM 703 (e.g., on partition p₁,v₂ of OFM 703).

The second processing resource performs the following partial matrixcalculation using the matrix operands on partition p₂ of IFM1 701 andIFM2 702: ΔC₁HW×N*ΔK₂PQ×N=ΔC₁RS×ΔK₂. The result is stored in thecorresponding location of OFM 703 (e.g., on partition p₂,v₃ of OFM 703).

The third processing resource performs the following partial matrixcalculation using the matrix operands on partition p₃ of IFM1 701 andIFM2 702: ΔC₂HW×N*ΔK₃PQ×N=ΔC₂RS×ΔK₃. The result is stored in thecorresponding location of OFM 703 (e.g., on partition p₃,v₄ of OFM 703).

Finally, the fourth processing resource performs the following partialmatrix calculation using the matrix operands on partition p₄ of IFM1 701and IFM2 702: ΔC₃HW×N*ΔK₀PQ×N=ΔC₃RS×ΔK₀. The result is stored in thecorresponding location of OFM 703 (e.g., on partition p₄,v₁ of OFM 703).

Moreover, while the processing resources are performing the partialmatrix calculations in stage 2, each processing resource simultaneouslysends and receives partitions of IFM2 702 to and from its neighborprocessing resources. Accordingly, during stage 2 of the weight updateoperation, the partitions of IFM2 702 are shifted across the processingresources, in a similar manner as described for stage 1 of FIG. 7C(e.g., using single-cyclical, dual-cyclical, or other cyclical-basedconfigurations). For example, in FIG. 7D, the partial matrix operands ofIFM2 702 are shifted as follows:

-   -   The 4^(th) processing resource sends its partition of IFM2 702        (e.g., ΔK₀PQ×N) to the 3^(rd) processing resource (e.g., the        matrix operand in partition p₄ of IFM2 702 is shifted up to        partition p₃ of IFM2 702).    -   The 3^(rd) processing resource sends its partition of IFM2 702        (e.g., ΔK₃PQ×N) to the 2^(nd) processing resource (e.g., the        matrix operand in partition p₃ of IFM2 702 is shifted up to        partition p₂ of IFM2 702).    -   The 2^(nd) processing resource sends its partition of IFM2 702        (e.g., ΔK₂PQ×N) to the 1^(st) processing resource (e.g., the        matrix operand in partition p₂ of IFM2 702 is shifted up to        partition p₁ of IFM2 702).    -   The 1^(st) processing resource sends its partition of IFM2 702        (e.g., ΔK₁PQ×N) to the 4^(th) processing resource (e.g., the        matrix operand in partition p₁ of IFM2 702 is shifted down to        partition p₄ of IFM2 702).

Each processing resource may then use the partial matrix operandsreceived from neighboring processing resource(s) in subsequent stages,as described below in connection with FIGS. 7E-F.

FIG. 7E illustrates stage 3 of the weight update operation. As describedabove in connection with stage 2 of FIG. 7D, the partitions of IFM2 702were shifted across the processing resources during stage 2 of theweight update operation. Accordingly, in stage 3 of the weight updateoperation, each processing resource performs a partial matrixcalculation using its respective partitions of IFM1 701 and IFM2 702, asillustrated in FIG. 7E and described further below. In some embodiments,for example, the partial matrix calculation performed by each processingresource (represented by asterisks (*) in the discussion below) may be amatrix multiplication operation.

The first processing resource performs the following partial matrixcalculation using the matrix operands on partition p₁ of IFM1 701 andIFM2 702: ΔC₀HW×N*ΔK₂PQ×N=ΔC₀RS×ΔK₂. The result is stored in thecorresponding location of OFM 703 (e.g., on partition p₁,v₃ of OFM 703).

The second processing resource performs the following partial matrixcalculation using the matrix operands on partition p₂ of IFM1 701 andIFM2 702: ΔC₁HW×N*ΔK₃PQ×N=ΔC₁RS×ΔK₃. The result is stored in thecorresponding location of OFM 703 (e.g., on partition p₂,v₄ of OFM 703).

The third processing resource performs the following partial matrixcalculation using the matrix operands on partition p₃ of IFM1 701 andIFM2 702: ΔC₂HW×N*ΔK₀PQ×N=ΔC₂RS×ΔK₀. The result is stored in thecorresponding location of OFM 703 (e.g., on partition p₃,v₁ of OFM 703).

Finally, the fourth processing resource performs the following partialmatrix calculation using the matrix operands on partition p₄ of IFM1 701and IFM2 702: ΔC₃HW×N*ΔK₁PQ×N=ΔC₃RS×ΔK₁. The result is stored in thecorresponding location of OFM 703 (e.g., on partition p₄,v₂ of OFM 703).

Moreover, while the processing resources are performing the partialmatrix calculations in stage 3, each processing resource simultaneouslysends and receives partitions of IFM2 702 to and from its neighborprocessing resources. Accordingly, during stage 3 of the weight updateoperation, the partitions of IFM2 702 are shifted across the processingresources, in a similar manner as described for stages 1 and 2 of FIGS.7C-D (e.g., using single-cyclical, dual-cyclical, or othercyclical-based configurations). For example, in FIG. 7E, the partialmatrix operands of IFM2 702 are shifted as follows:

-   -   The 4^(th) processing resource sends its partition of IFM2 702        (e.g., ΔK₁PQ×N) to the 3^(rd) processing resource (e.g., the        matrix operand in partition p₄ of IFM2 702 is shifted up to        partition p₃ of IFM2 702).    -   The 3^(rd) processing resource sends its partition of IFM2 702        (e.g., ΔK₀PQ×N) to the 2^(nd) processing resource (e.g., the        matrix operand in partition p₃ of IFM2 702 is shifted up to        partition p₂ of IFM2 702).    -   The 2^(nd) processing resource sends its partition of IFM2 702        (e.g., ΔK₃PQ×N) to the 1^(st) processing resource (e.g., the        matrix operand in partition p₂ of IFM2 702 is shifted up to        partition p₁ of IFM2 702).    -   The 1^(st) processing resource sends its partition of IFM2 702        (e.g., ΔK₂PQ×N) to the 4^(th) processing resource (e.g., the        matrix operand in partition p₁ of IFM2 702 is shifted down to        partition p₄ of IFM2 702).

Each processing resource may then use the partial matrix operandsreceived from neighboring processing resource(s) in subsequent stages,as described below in connection with FIG. 7F.

FIG. 7F illustrates stage 4 of the weight update operation. As describedabove in connection with stage 3 of FIG. 7E, the partitions of IFM2 702were shifted across the processing resources during stage 3 of theweight update operation. Accordingly, in stage 4 of the weight updateoperation, each processing resource performs a partial matrixcalculation using its respective partitions of IFM1 701 and IFM2 702, asillustrated in FIG. 7F and described further below. In some embodiments,for example, the partial matrix calculation performed by each processingresource (represented by asterisks (*) in the discussion below) may be amatrix multiplication operation.

The first processing resource performs the following partial matrixcalculation using the matrix operands on partition p₁ of IFM1 701 andIFM2 702: ΔC₀HW×N*ΔK₃PQ×N=ΔC₀RS×ΔK₃. The result is stored in thecorresponding location of OFM 703 (e.g., on partition p_(l),v₄ of OFM703).

The second processing resource performs the following partial matrixcalculation using the matrix operands on partition p₂ of IFM1 701 andIFM2 702: ΔC₁HW×N*ΔK₀PQ×N=ΔC₁RS×ΔK₀. The result is stored in thecorresponding location of OFM 703 (e.g., on partition p₂,v_(l) of OFM703).

The third processing resource performs the following partial matrixcalculation using the matrix operands on partition p₃ of IFM1 701 andIFM2 702: ΔC₂HW×N*ΔK₁PQ×N=ΔC₂RS×ΔK₁. The result is stored in thecorresponding location of OFM 703 (e.g., on partition p₃,v₂ of OFM 703).

Finally, the fourth processing resource performs the following partialmatrix calculation using the matrix operands on partition p₄ of IFM1 701and IFM2 702: ΔC₃HW×N*ΔK₂PQ×N=ΔC₃RS×ΔK₂. The result is stored in thecorresponding location of OFM 703 (e.g., on partition p₄,v₃ of OFM 703).

After the partial matrix calculations of stage 4 are complete, allpartial results of the weight update operation have been calculated andare stored in OFM 703. Accordingly, the weight update operation iscomplete.

FIG. 8 illustrates a flowchart 800 for an example embodiment ofdistributed matrix operations associated with convolutions. Flowchart800 may be implemented, in some embodiments, by components describedthroughout this disclosure (e.g., the matrix processing architecture ofFIGS. 2A-C).

The flowchart may begin at block 802 by receiving a command to perform amatrix operation. The matrix operation, for example, may comprise anoperation on a plurality of input matrices (e.g., matrix operands).Moreover, the matrix operation may be associated with one or moreconvolution operations.

Convolution operations, for example, may be used for image processing.For example, a convolution operation may involve applying a filter to animage. The filter may be used to modify the image (e.g., applying visualeffects), detect certain features in the image (e.g., facial recognitionor identification of other objects), and so forth. Moreover, in someembodiments, the image and filter of a convolution operation may berepresented using matrices. For example, a color image may berepresented by a three-dimensional (3D) matrix with dimensionscorresponding to the number of channels (C), height (H), and width (W)of the image. Similarly, a filter may be represented by a 3D matrix withdimensions corresponding to the number of channels (C), height (R), andwidth (S) of the filter. In these embodiments, a convolution operationmay be performed by moving the filter throughout the image and computingthe dot product between the filter and the various portions of theimage. Moreover, in some embodiments, when convolution operations needto be performed on multiple images and using multiple filters, theimages may be processed together to increase processing efficiency.Thus, in some embodiments, a collection of images may be representedusing a four-dimensional (4D) matrix, with dimensions corresponding tothe number of channels (C), image height (H), image width (W), andnumber of images (N). Similarly, a collection of filters may berepresented using a 4D matrix, with dimensions corresponding to thenumber of filters (K), number of channels (C), filter height (R), andfilter width (S). Accordingly, a convolution operation may then beperformed using the 4D matrices that are used to represent the imagesand filters.

In some embodiments, convolution operations may be used to implementcomputer vision artificial intelligence and machine learningcapabilities in an artificial neural network. For example, in someembodiments, the matrix operation of block 802 may be associated withoperations in an artificial neural network, such as forward propagation,backward propagation, and/or weight update operations.

The flowchart may then proceed to block 804 to partition the inputmatrices into a plurality of partitions based on the number of availableprocessing elements. In some embodiments, the input matrices may bepartitioned based on the hierarchical arrangement of processingresources, as described further in connection with block 806. In someembodiments, the partitions may be across any of the various dimensionsof the input matrices, such as the channels (C), images (N), and/orfilters (K) dimensions.

The flowchart may then proceed to block 806 to distribute the partitionsto the available processing elements. For example, in some embodiments,each partition may be distributed to a particular processing element.Moreover, in some embodiments, the processing elements may be configuredin a hierarchical arrangement with a plurality of processing levels, andthe matrix operation may be distributed across the hierarchy ofprocessing levels. For example, in some embodiments, the processingelements may include multiple matrix processing chips (e.g., matrixprocessing chips 220 of FIG. 2A), multiple high bandwidth memory (HBM)modules on each matrix processing chip (e.g., HBM modules 240 of FIG.2B), multiple matrix processing clusters on each matrix processing chip(e.g., matrix processing clusters 230 of FIG. 2B), and/or multiplematrix processing units (MPUs) on each matrix processing cluster (e.g.,MPUs 234 of FIG. 2C). In those embodiments, the matrix operation mayfirst be partitioned and distributed across the matrix processing chips.The partial matrix operation distributed to a particular matrixprocessing chip may then be similarly partitioned and distributed acrossthe matrix processing clusters and/or high bandwidth memory (HBM)modules of the particular matrix processing chip. For example, in somecases, the partial matrix operation may be distributed across the matrixprocessing clusters of the matrix processing chip. Alternatively, thepartial matrix operation may first be distributed across various“logical processing nodes” of the matrix processing chip (e.g., groupsof matrix processing clusters associated with an HBM module), and maythen be distributed across the matrix processing clusters of aparticular logical processing node. The partition and partial matrixoperation distributed to a particular matrix processing cluster may thenbe similarly partitioned and distributed across the matrix processingunits (MPUs) of the particular matrix processing cluster.

Moreover, in some cases, a partial matrix operation distributed to aparticular processing element may be distributed across the height (P)and width (Q) of the corresponding output of the partial matrixoperation. For example, a partial matrix operation distributed to alogical processing node may be distributed to the associated matrixprocessing clusters across the height (P) of the output matrix, and thepartial matrix operation distributed to each matrix processing clustermay then be distributed to the matrix processing units (MPUs) across thewidth (Q) of the output matrix.

The flowchart may then proceed to block 808 to perform partial matrixoperations using the processing elements. For example, each processingelement may perform a partial matrix operation based on the matrix datadistributed to that processing element.

The flowchart may then proceed to block 810 to transmit partial matrixdata between processing elements while performing the partial matrixoperations. For example, in some embodiments, the processing elementsmay be configured in a cyclical arrangement such that each processingelement is communicatively coupled to multiple neighbor processingelements. Moreover, the partial matrix operations may be performed in aplurality of stages, and each processing element may transmit partialmatrix data to its neighbor processing elements while performing aparticular stage of the partial matrix operations. For example, in someembodiments, each processing element may transmit partial matrix data toone of its neighbor processing elements (e.g., using a single-cyclicalapproach) or to both of its neighbor processing elements (e.g., using adual-cyclical approach) during each stage of partial matrix operations.For example, a first processing element may use or calculate partialmatrix data in a particular stage of the partial matrix operations, thefirst processing element may transmit the partial matrix data to asecond processing element, and the second processing element may thenuse the partial matrix data in a subsequent stage of the partial matrixoperations. For some matrix operations, the partial matrix data mayinclude a partial input matrix, while for other matrix operations, thepartial matrix data may include a partial result matrix.

The flowchart may then proceed to block 812 to determine a result of thematrix operation. For example, the result of the matrix operation may bedetermined based on the partial results collectively computed by theprocessing elements.

At this point, the flowchart may be complete. In some embodiments,however, the flowchart may restart and/or certain blocks may berepeated. For example, in some embodiments, the flowchart may restart atblock 802 to continue receiving and processing commands to performmatrix operations.

The flowcharts and block diagrams in the FIGURES illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods and computer program products according to variousaspects of the present disclosure. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof code, which comprises one or more executable instructions forimplementing the specified logical function(s). It should also be notedthat, in some alternative implementations, the functions noted in theblock may occur out of the order noted in the figures. For example, twoblocks shown in succession may, in fact, be executed substantiallyconcurrently, or the blocks may sometimes be executed in the reverseorder or alternative orders, depending upon the functionality involved.It will also be noted that each block of the block diagrams and/orflowchart illustration, and combinations of blocks in the block diagramsand/or flowchart illustration, can be implemented by special purposehardware-based systems that perform the specified functions or acts, orcombinations of special purpose hardware and computer instructions.

The foregoing disclosure outlines features of several embodiments sothat those skilled in the art may better understand various aspects ofthe present disclosure. Those skilled in the art should appreciate thatthey may readily use the present disclosure as a basis for designing ormodifying other processes and structures for carrying out the samepurposes and/or achieving the same advantages of the embodimentsintroduced herein. Those skilled in the art should also realize thatsuch equivalent constructions do not depart from the spirit and scope ofthe present disclosure, and that they may make various changes,substitutions, and alterations herein without departing from the spiritand scope of the present disclosure.

All or part of any hardware element disclosed herein may readily beprovided in a system-on-a-chip (SoC), including a central processingunit (CPU) package. An SoC represents an integrated circuit (IC) thatintegrates components of a computer or other electronic system into asingle chip. The SoC may contain digital, analog, mixed-signal, andradio frequency functions, all of which may be provided on a single chipsubstrate. Other embodiments may include a multi-chip-module (MCM), witha plurality of chips located within a single electronic package andconfigured to interact closely with each other through the electronicpackage. In various other embodiments, the computing functionalitiesdisclosed herein may be implemented in one or more silicon cores inApplication Specific Integrated Circuits (ASICs), Field ProgrammableGate Arrays (FPGAs), and other semiconductor chips.

As used throughout this specification, the term “processor” or“microprocessor” should be understood to include not only a traditionalmicroprocessor (such as Intel's® industry-leading x86 and x64architectures), but also matrix processors, graphics processors, and anyASIC, FPGA, microcontroller, digital signal processor (DSP),programmable logic device, programmable logic array (PLA), microcode,instruction set, emulated or virtual machine processor, or any similar“Turing-complete” device, combination of devices, or logic elements(hardware or software) that permit the execution of instructions.

Note also that in certain embodiments, some of the components may beomitted or consolidated. In a general sense, the arrangements depictedin the figures should be understood as logical divisions, whereas aphysical architecture may include various permutations, combinations,and/or hybrids of these elements. It is imperative to note thatcountless possible design configurations can be used to achieve theoperational objectives outlined herein. Accordingly, the associatedinfrastructure has a myriad of substitute arrangements, design choices,device possibilities, hardware configurations, software implementations,and equipment options.

In a general sense, any suitably-configured processor can executeinstructions associated with data or microcode to achieve the operationsdetailed herein. Any processor disclosed herein could transform anelement or an article (for example, data) from one state or thing toanother state or thing. In another example, some activities outlinedherein may be implemented with fixed logic or programmable logic (forexample, software and/or computer instructions executed by a processor)and the elements identified herein could be some type of a programmableprocessor, programmable digital logic (for example, a field programmablegate array (FPGA), an erasable programmable read only memory (EPROM), anelectrically erasable programmable read only memory (EEPROM)), an ASICthat includes digital logic, software, code, electronic instructions,flash memory, optical disks, CD-ROMs, DVD ROMs, magnetic or opticalcards, other types of machine-readable mediums suitable for storingelectronic instructions, or any suitable combination thereof.

In operation, a storage may store information in any suitable type oftangible, non-transitory storage medium (for example, random accessmemory (RAM), read only memory (ROM), field programmable gate array(FPGA), erasable programmable read only memory (EPROM), electricallyerasable programmable ROM (EEPROM), or microcode), software, hardware(for example, processor instructions or microcode), or in any othersuitable component, device, element, or object where appropriate andbased on particular needs. Furthermore, the information being tracked,sent, received, or stored in a processor could be provided in anydatabase, register, table, cache, queue, control list, or storagestructure, based on particular needs and implementations, all of whichcould be referenced in any suitable timeframe. Any of the memory orstorage elements disclosed herein should be construed as beingencompassed within the broad terms ‘memory’ and ‘storage,’ asappropriate. A non-transitory storage medium herein is expresslyintended to include any non-transitory special-purpose or programmablehardware configured to provide the disclosed operations, or to cause aprocessor to perform the disclosed operations. A non-transitory storagemedium also expressly includes a processor having stored thereonhardware-coded instructions, and optionally microcode instructions orsequences encoded in hardware, firmware, or software.

Computer program logic implementing all or part of the functionalitydescribed herein is embodied in various forms, including, but in no waylimited to, hardware description language, a source code form, acomputer executable form, machine instructions or microcode,programmable hardware, and various intermediate forms (for example,forms generated by an HDL processor, assembler, compiler, linker, orlocator). In an example, source code includes a series of computerprogram instructions implemented in various programming languages, suchas an object code, an assembly language, or a high-level language suchas OpenCL, FORTRAN, C, C++, JAVA, or HTML for use with various operatingsystems or operating environments, or in hardware description languagessuch as Spice, Verilog, and VHDL. The source code may define and usevarious data structures and communication messages. The source code maybe in a computer executable form (e.g., via an interpreter), or thesource code may be converted (e.g., via a translator, assembler, orcompiler) into a computer executable form, or converted to anintermediate form such as byte code. Where appropriate, any of theforegoing may be used to build or describe appropriate discrete orintegrated circuits, whether sequential, combinatorial, state machines,or otherwise.

In one example, any number of electrical circuits of the FIGURES may beimplemented on a board of an associated electronic device. The board canbe a general circuit board that can hold various components of theinternal electronic system of the electronic device and, further,provide connectors for other peripherals. More specifically, the boardcan provide the electrical connections by which the other components ofthe system can communicate electrically. Any suitable processor andmemory can be suitably coupled to the board based on particularconfiguration needs, processing demands, and computing designs. Othercomponents such as external storage, additional sensors, controllers foraudio/video display, and peripheral devices may be attached to the boardas plug-in cards, via cables, or integrated into the board itself. Inanother example, the electrical circuits of the FIGURES may beimplemented as stand-alone modules (e.g., a device with associatedcomponents and circuitry configured to perform a specific application orfunction) or implemented as plug-in modules into application specifichardware of electronic devices.

Note that with the numerous examples provided herein, interaction may bedescribed in terms of two, three, four, or more electrical components.However, this has been done for purposes of clarity and example only. Itshould be appreciated that the system can be consolidated orreconfigured in any suitable manner. Along similar design alternatives,any of the illustrated components, modules, and elements of the FIGURESmay be combined in various possible configurations, all of which arewithin the broad scope of this specification. In certain cases, it maybe easier to describe one or more of the functionalities of a given setof flows by only referencing a limited number of electrical elements. Itshould be appreciated that the electrical circuits of the FIGURES andits teachings are readily scalable and can accommodate a large number ofcomponents, as well as more complicated/sophisticated arrangements andconfigurations. Accordingly, the examples provided should not limit thescope or inhibit the broad teachings of the electrical circuits aspotentially applied to a myriad of other architectures.

Numerous other changes, substitutions, variations, alterations, andmodifications may be ascertained to one skilled in the art and it isintended that the present disclosure encompass all such changes,substitutions, variations, alterations, and modifications as fallingwithin the scope of the appended claims.

Example Implementations

The following examples pertain to embodiments described throughout thisdisclosure.

One or more embodiments may include an apparatus, comprising: aplurality of memory elements to store matrix data; and a plurality ofprocessing elements to perform a matrix operation using a plurality ofinput matrices, wherein the matrix operation is associated with one ormore convolution operations; wherein the plurality of processingelements is configured to: partition the plurality of input matricesinto a plurality of input partitions, wherein the plurality of inputmatrices is partitioned based on a number of available processingelements; distribute the plurality of input partitions among theplurality of processing elements, wherein each input partition isdistributed to a particular processing element of the plurality ofprocessing elements; perform a plurality of partial matrix operationsusing the plurality of processing elements; transmit partial matrix databetween the plurality of processing elements while performing theplurality of partial matrix operations; and determine a result of thematrix operation based on the plurality of partial matrix operations.

In one example embodiment of an apparatus: the plurality of processingelements is configured in a hierarchical arrangement comprising aplurality of processing levels; and the plurality of processing elementsis further configured to distribute the matrix operation across theplurality of processing levels.

In one example embodiment of an apparatus, the plurality of inputmatrices comprises matrix data associated with one or more images andone or more filters, wherein the one or more images are associated withone or more channels.

In one example embodiment of an apparatus, the plurality of processingelements is further configured to partition the plurality of inputmatrices based on one or more of: a number of channels associated withthe one or more images; a number of filters; and a number of images.

In one example embodiment of an apparatus, the plurality of processingelements is further configured to distribute the plurality of partialmatrix operations among the plurality of processing elements based on aheight and a width of the result of the matrix operation.

In one example embodiment of an apparatus: the plurality of processingelements is configured in a cyclic arrangement such that each processingelement is communicatively coupled to a plurality of neighbor processingelements; and the plurality of processing elements is further configuredto: perform the plurality of partial matrix operations in a plurality ofstages; and transmit a portion of the partial matrix data from eachprocessing element to one or more of the neighbor processing elementswhile performing a particular stage of the partial matrix operations.

In one example embodiment of an apparatus, the partial matrix datacomprises a partial input matrix, wherein the partial input matrix is tobe used by a first processing element in a particular stage of thepartial matrix operations, and wherein the partial input matrix is to beused by a second processing element in a subsequent stage of the partialmatrix operations.

In one example embodiment of an apparatus, the partial matrix datacomprises a partial result matrix determined by a first processingelement in a particular stage of the partial matrix operations, andwherein the partial result matrix is to be used by a second processingelement in a subsequent stage of the partial matrix operations.

In one example embodiment of an apparatus, the plurality of processingelements comprises: a plurality of matrix processing chips; a pluralityof logical processing nodes associated with each matrix processing chip;and a memory element and a plurality of matrix processing clustersassociated with each logical processing node.

In one example embodiment of an apparatus, the matrix operation isassociated with a weight update operation in a neural network.

In one example embodiment of an apparatus, the matrix operation isassociated with a forward propagation operation in a neural network.

In one example embodiment of an apparatus, the matrix operation isassociated with a backward propagation operation in a neural network.

One or more embodiments may include a method, comprising: performing amatrix operation using a plurality of input matrices, wherein the matrixoperation is associated with one or more convolution operations, andwherein performing the matrix operation comprises: partitioning theplurality of input matrices into a plurality of input partitions,wherein the plurality of input matrices is partitioned based on a numberof available processing elements; distributing the plurality of inputpartitions among a plurality of processing elements, wherein each inputpartition is distributed to a particular processing element of theplurality of processing elements; performing a plurality of partialmatrix operations using the plurality of processing elements;transmitting partial matrix data between the plurality of processingelements while performing the plurality of partial matrix operations;and determining a result of the matrix operation based on the pluralityof partial matrix operations.

In one example embodiment of a method: the plurality of processingelements is configured in a hierarchical arrangement comprising aplurality of processing levels; and the matrix operation is distributedacross the plurality of processing levels.

In one example embodiment of a method, the plurality of processingelements comprises: a plurality of matrix processing chips; a pluralityof logical processing nodes associated with each matrix processing chip;and a memory element and a plurality of matrix processing clustersassociated with each logical processing node.

In one example embodiment of a method, the plurality of input matricescomprises matrix data associated with one or more images and one or morefilters, wherein the one or more images are associated with one or morechannels.

In one example embodiment of a method, the plurality of input matricesis further partitioned based on one or more of: a number of channelsassociated with the one or more images; a number of filters; and anumber of images.

In one example embodiment of a method, the method further comprisesdistributing the plurality of partial matrix operations to the pluralityof processing elements based on a height and a width of the result ofthe matrix operation.

In one example embodiment of a method, the plurality of processingelements is configured in a cyclic arrangement such that each processingelement is communicatively coupled to a plurality of neighbor processingelements.

In one example embodiment of a method, the plurality of partial matrixoperations is performed in a plurality of stages, and wherein eachprocessing element transmits a portion of the partial matrix data to oneor more of the neighbor processing elements while performing aparticular stage of the partial matrix operations.

In one example embodiment of a method, the partial matrix data comprisesa partial input matrix, wherein the partial input matrix is used by afirst processing element in a particular stage of the partial matrixoperations, and wherein the partial input matrix is used by a secondprocessing element in a subsequent stage of the partial matrixoperations.

In one example embodiment of a method, the matrix operation isassociated with a weight update operation in a neural network.

In one example embodiment of a method, the partial matrix data comprisesa partial result matrix determined by a first processing element in aparticular stage of the partial matrix operations, and wherein thepartial result matrix is used by a second processing element in asubsequent stage of the partial matrix operations.

In one example embodiment of a method, the matrix operation isassociated with a forward propagation operation in a neural network.

In one example embodiment of a method, the matrix operation isassociated with a backward propagation operation in a neural network.

One or more embodiments may include a system, comprising: a plurality ofmemory elements to store matrix data; a plurality of processing elementsto perform a matrix operation using a plurality of input matrices,wherein the matrix operation is associated with one or more convolutionoperations, and wherein the plurality of processing elements comprises:a host processor; one or more matrix processing chips; a plurality ofmatrix processors associated with the one or more matrix processingchips; wherein the plurality of processing elements is configured to:partition the plurality of input matrices into a plurality of inputpartitions, wherein the plurality of input matrices is partitioned basedon a number of available processing elements; distribute the pluralityof input partitions among the plurality of processing elements, whereineach input partition is distributed to a particular processing elementof the plurality of processing elements; perform a plurality of partialmatrix operations using the plurality of processing elements; transmitpartial matrix data between the plurality of processing elements whileperforming the plurality of partial matrix operations; and determine aresult of the matrix operation based on the plurality of partial matrixoperations.

In one example embodiment of a system, the system further comprises acommunication interface to communicate with one or more remote matrixprocessing chips over a communication network.

One or more embodiments may include at least one machine accessiblestorage medium having instructions stored thereon, the instructions,when executed on a machine, cause the machine to: perform a matrixoperation using a plurality of input matrices, wherein the matrixoperation is associated with one or more convolution operations, andwherein the instructions that cause the machine to perform the matrixoperation further cause the machine to: partition the plurality of inputmatrices into a plurality of input partitions, wherein the plurality ofinput matrices is partitioned based on a number of available processingelements; distribute the plurality of input partitions among a pluralityof processing elements, wherein each input partition is distributed to aparticular processing element of the plurality of processing elements;perform a plurality of partial matrix operations using the plurality ofprocessing elements; transmit partial matrix data between the pluralityof processing elements while performing the plurality of partial matrixoperations; and determine a result of the matrix operation based on theplurality of partial matrix operations.

In one example embodiment of a storage medium, the plurality of inputmatrices comprises matrix data associated with one or more images andone or more filters, wherein the one or more images are associated withone or more channels.

In one example embodiment of a storage medium, the instructions furthercause the machine to partition the plurality of input matrices based onone or more of: a number of channels associated with the one or moreimages; a number of filters; and a number of images.

In one example embodiment of a storage medium, the instructions furthercause the machine to distribute the plurality of partial matrixoperations to the plurality of processing elements based on a height anda width of the result of the matrix operation.

In one example embodiment of a storage medium, the plurality ofprocessing elements is configured in a cyclic arrangement such that eachprocessing element is communicatively coupled to a plurality of neighborprocessing elements.

In one example embodiment of a storage medium, the instructions furthercause the machine to: perform the plurality of partial matrix operationsin a plurality of stages; and transmit a portion of the partial matrixdata from each processing element to one or more of the neighborprocessing elements while performing a particular stage of the partialmatrix operations.

What is claimed is:
 1. An apparatus, comprising: a plurality of memoryelements to store matrix data; and a plurality of processing elements toperform a matrix operation using a plurality of input matrices, whereinthe matrix operation is associated with one or more convolutionoperations; wherein the plurality of processing elements is configuredto: partition the plurality of input matrices into a plurality of inputpartitions, wherein the plurality of input matrices is partitioned basedon a number of available processing elements; distribute the pluralityof input partitions among the plurality of processing elements, whereineach input partition is distributed to a particular processing elementof the plurality of processing elements; perform a plurality of partialmatrix operations using the plurality of processing elements; transmitpartial matrix data between the plurality of processing elements whileperforming the plurality of partial matrix operations; and determine aresult of the matrix operation based on the plurality of partial matrixoperations.
 2. The apparatus of claim 1, wherein: the plurality ofprocessing elements is configured in a hierarchical arrangementcomprising a plurality of processing levels; and the plurality ofprocessing elements is further configured to distribute the matrixoperation across the plurality of processing levels.
 3. The apparatus ofclaim 2, wherein the plurality of processing elements comprises: aplurality of matrix processing chips; a plurality of logical processingnodes associated with each matrix processing chip; and a memory elementand a plurality of matrix processing clusters associated with eachlogical processing node.
 4. The apparatus of claim 1, wherein theplurality of input matrices comprises matrix data associated with one ormore images and one or more filters, wherein the one or more images areassociated with one or more channels.
 5. The apparatus of claim 4,wherein the plurality of processing elements is further configured topartition the plurality of input matrices based on one or more of: anumber of channels associated with the one or more images; a number offilters; and a number of images.
 6. The apparatus of claim 1, whereinthe plurality of processing elements is further configured to distributethe plurality of partial matrix operations among the plurality ofprocessing elements based on a height and a width of the result of thematrix operation.
 7. The apparatus of claim 1, wherein: the plurality ofprocessing elements is configured in a cyclic arrangement such that eachprocessing element is communicatively coupled to a plurality of neighborprocessing elements; and the plurality of processing elements is furtherconfigured to: perform the plurality of partial matrix operations in aplurality of stages; and transmit a portion of the partial matrix datafrom each processing element to one or more of the neighbor processingelements while performing a particular stage of the partial matrixoperations.
 8. The apparatus of claim 7, wherein the partial matrix datacomprises a partial input matrix, wherein the partial input matrix is tobe used by a first processing element in a particular stage of thepartial matrix operations, and wherein the partial input matrix is to beused by a second processing element in a subsequent stage of the partialmatrix operations.
 9. The apparatus of claim 8, wherein the matrixoperation is associated with a weight update operation in a neuralnetwork.
 10. The apparatus of claim 7, wherein the partial matrix datacomprises a partial result matrix determined by a first processingelement in a particular stage of the partial matrix operations, andwherein the partial result matrix is to be used by a second processingelement in a subsequent stage of the partial matrix operations.
 11. Theapparatus of claim 10, wherein the matrix operation is associated with aforward propagation operation in a neural network.
 12. The apparatus ofclaim 10, wherein the matrix operation is associated with a backwardpropagation operation in a neural network.
 13. A method, comprising:performing a matrix operation using a plurality of input matrices,wherein the matrix operation is associated with one or more convolutionoperations, and wherein performing the matrix operation comprises:partitioning the plurality of input matrices into a plurality of inputpartitions, wherein the plurality of input matrices is partitioned basedon a number of available processing elements; distributing the pluralityof input partitions among a plurality of processing elements, whereineach input partition is distributed to a particular processing elementof the plurality of processing elements; performing a plurality ofpartial matrix operations using the plurality of processing elements;transmitting partial matrix data between the plurality of processingelements while performing the plurality of partial matrix operations;and determining a result of the matrix operation based on the pluralityof partial matrix operations.
 14. The method of claim 13, wherein: theplurality of input matrices comprises matrix data associated with one ormore images and one or more filters, wherein the one or more images areassociated with one or more channels; and the plurality of inputmatrices is further partitioned based on one or more of: a number ofchannels associated with the one or more images; a number of filters;and a number of images.
 15. The method of claim 13, further comprisingdistributing the plurality of partial matrix operations to the pluralityof processing elements based on a height and a width of the result ofthe matrix operation.
 16. The method of claim 13, wherein the pluralityof processing elements is configured in a cyclic arrangement such thateach processing element is communicatively coupled to a plurality ofneighbor processing elements.
 17. The method of claim 16, wherein theplurality of partial matrix operations is performed in a plurality ofstages, and wherein each processing element transmits a portion of thepartial matrix data to one or more of the neighbor processing elementswhile performing a particular stage of the partial matrix operations.18. A system, comprising: a plurality of memory elements to store matrixdata; a plurality of processing elements to perform a matrix operationusing a plurality of input matrices, wherein the matrix operation isassociated with one or more convolution operations, and wherein theplurality of processing elements comprises: a host processor; one ormore matrix processing chips; a plurality of matrix processorsassociated with the one or more matrix processing chips; wherein theplurality of processing elements is configured to: partition theplurality of input matrices into a plurality of input partitions,wherein the plurality of input matrices is partitioned based on a numberof available processing elements; distribute the plurality of inputpartitions among the plurality of processing elements, wherein eachinput partition is distributed to a particular processing element of theplurality of processing elements; perform a plurality of partial matrixoperations using the plurality of processing elements; transmit partialmatrix data between the plurality of processing elements whileperforming the plurality of partial matrix operations; and determine aresult of the matrix operation based on the plurality of partial matrixoperations.
 19. The system of claim 18, further comprising acommunication interface to communicate with one or more remote matrixprocessing chips over a communication network.
 20. At least one machineaccessible storage medium having instructions stored thereon, theinstructions, when executed on a machine, cause the machine to: performa matrix operation using a plurality of input matrices, wherein thematrix operation is associated with one or more convolution operations,and wherein the instructions that cause the machine to perform thematrix operation further cause the machine to: partition the pluralityof input matrices into a plurality of input partitions, wherein theplurality of input matrices is partitioned based on a number ofavailable processing elements; distribute the plurality of inputpartitions among a plurality of processing elements, wherein each inputpartition is distributed to a particular processing element of theplurality of processing elements; perform a plurality of partial matrixoperations using the plurality of processing elements; transmit partialmatrix data between the plurality of processing elements whileperforming the plurality of partial matrix operations; and determine aresult of the matrix operation based on the plurality of partial matrixoperations.
 21. The storage medium of claim 20, wherein the plurality ofinput matrices comprises matrix data associated with one or more imagesand one or more filters, wherein the one or more images are associatedwith one or more channels.
 22. The storage medium of claim 21, whereinthe instructions further cause the machine to partition the plurality ofinput matrices based on one or more of: a number of channels associatedwith the one or more images; a number of filters; and a number ofimages.
 23. The storage medium of claim 20, wherein the instructionsfurther cause the machine to distribute the plurality of partial matrixoperations to the plurality of processing elements based on a height anda width of the result of the matrix operation.
 24. The storage medium ofclaim 20, wherein the plurality of processing elements is configured ina cyclic arrangement such that each processing element iscommunicatively coupled to a plurality of neighbor processing elements.25. The storage medium of claim 24, wherein the instructions furthercause the machine to: perform the plurality of partial matrix operationsin a plurality of stages; and transmit a portion of the partial matrixdata from each processing element to one or more of the neighborprocessing elements while performing a particular stage of the partialmatrix operations.